diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-12-15 23:49:18 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-12-25 07:13:19 +0100 |
commit | 567c19a62ceb9fbc2b35980849270b26598f5a40 (patch) | |
tree | cc3ffd230f42003acc77954455d240ff587b9095 /src/udev/udev-rules.c | |
parent | udev: do not import property value from truncated line of program result (diff) | |
download | systemd-567c19a62ceb9fbc2b35980849270b26598f5a40.tar.xz systemd-567c19a62ceb9fbc2b35980849270b26598f5a40.zip |
udev: refuse to process line when invalid program output is obtained
Diffstat (limited to '')
-rw-r--r-- | src/udev/udev-rules.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c index a610dea0d9..836a7789fb 100644 --- a/src/udev/udev-rules.c +++ b/src/udev/udev-rules.c @@ -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; |