From: gaoyi Date: Sun, 12 Jul 2020 07:24:42 +0000 (-0400) Subject: udev: specify the end of value X-Git-Tag: v246-rc2~87^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1e67a9c2cd6065b850d2fd5e376d8b9bff63bdbc;p=thirdparty%2Fsystemd.git udev: specify the end of value NULSTR_FOREACH may read the illegal match Signed-off-by: gaoyi --- diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c index 4efafffd408..2d4eb3d3414 100644 --- a/src/udev/udev-rules.c +++ b/src/udev/udev-rules.c @@ -452,6 +452,11 @@ static int rule_line_add_token(UdevRuleLine *rule_line, UdevRuleTokenType type, } } *b = '\0'; + + /* Make sure the value is end, so NULSTR_FOREACH can read correct match */ + if (b < a) + b[1] = '\0'; + if (bar) empty = true;