diff options
author | Alin Popa <alin.popa@bmw.de> | 2020-02-14 09:33:43 +0100 |
---|---|---|
committer | INSUN PYO <insun.pyo@samsung.com> | 2021-03-22 20:55:21 +0900 |
commit | 492e8d38fed26e683762f6750bc6205324fecb2c (patch) | |
tree | e0435c28f69e63e2332be67ead72996a24cdfdbd /src/analyze | |
parent | 6a342b738481c9da3c1149432659f8c2eb1cc139 (diff) | |
download | systemd-492e8d38fed26e683762f6750bc6205324fecb2c.tar.gz systemd-492e8d38fed26e683762f6750bc6205324fecb2c.tar.bz2 systemd-492e8d38fed26e683762f6750bc6205324fecb2c.zip |
systemd: Fix busctl crash on aarch64 when setting output table formatsubmit/tizen/20210323.013050accepted/tizen/unified/20210324.124406
The enum used for column names is integer type while table_set_display() is parsing
arguments on size_t alignment which may result in assert in table_set_display() if
the size between types missmatch. This patch cast the enums to size_t.
It also fixes all other occurences for table_set_display() and
table_set_sort().
Change-Id: Ie225491ae3f9752183d6ea7993d02ef450ed6ab6
Diffstat (limited to 'src/analyze')
-rw-r--r-- | src/analyze/analyze-security.c | 4 | ||||
-rw-r--r-- | src/analyze/analyze.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/analyze/analyze-security.c b/src/analyze/analyze-security.c index 79b099a409..af0602d352 100644 --- a/src/analyze/analyze-security.c +++ b/src/analyze/analyze-security.c @@ -1447,11 +1447,11 @@ static int assess(const struct security_info *info, Table *overview_table, Analy if (!details_table) return log_oom(); - (void) table_set_sort(details_table, 3, 1, (size_t) -1); + (void) table_set_sort(details_table, (size_t) 3, (size_t) 1, (size_t) -1); (void) table_set_reverse(details_table, 3, true); if (getenv_bool("SYSTEMD_ANALYZE_DEBUG") <= 0) - (void) table_set_display(details_table, 0, 1, 2, 6, (size_t) -1); + (void) table_set_display(details_table, (size_t) 0, (size_t) 1, (size_t)2 , (size_t) 6, (size_t) -1); } for (i = 0; i < ELEMENTSOF(security_assessor_table); i++) { diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c index 19c4ce9cd9..2280f38718 100644 --- a/src/analyze/analyze.c +++ b/src/analyze/analyze.c @@ -1101,7 +1101,7 @@ static int analyze_blame(int argc, char *argv[], void *userdata) { if (r < 0) return r; - r = table_set_sort(table, 0, SIZE_MAX); + r = table_set_sort(table, (size_t) 0, (size_t) SIZE_MAX); if (r < 0) return r; |