From: Yu Watanabe Date: Wed, 15 May 2024 15:45:06 +0000 (+0900) Subject: systemctl: fix "applying zero offset to null pointer" UBSan error X-Git-Tag: v256-rc3~69 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=60dbecff27159a34be044b082d3688e62e67a4cb;p=thirdparty%2Fsystemd.git systemctl: fix "applying zero offset to null pointer" UBSan error Fixes #32837. --- diff --git a/src/systemctl/systemctl-list-unit-files.c b/src/systemctl/systemctl-list-unit-files.c index fc1ad9800ab..b8b1531834f 100644 --- a/src/systemctl/systemctl-list-unit-files.c +++ b/src/systemctl/systemctl-list-unit-files.c @@ -79,7 +79,7 @@ static int output_unit_file_list(const UnitFileList *units, unsigned c) { table_set_ersatz_string(table, TABLE_ERSATZ_DASH); - for (const UnitFileList *u = units; u < units + c; u++) { + FOREACH_ARRAY(u, units, c) { const char *on_underline = NULL, *on_unit_color = NULL, *id; bool underline;