udev: refuse to process line when invalid program output is obtained

This commit is contained in:
Yu Watanabe
2021-12-25 15:13:19 +09:00
parent 6b6e471a32
commit 567c19a62c
+5 -1
View File
@@ -1848,9 +1848,13 @@ static int udev_rule_apply_token_to_event(
}
r = strv_split_newlines_full(&lines, result, EXTRACT_RETAIN_ESCAPE);
if (r < 0)
if (r == -ENOMEM)
return log_oom();
if (r < 0) {
log_rule_warning_errno(dev, rules, r,
"Failed to extract lines from result of command \"%s\", ignoring: %m", buf);
return false;
}
STRV_FOREACH(line, lines) {
char *key, *value;