]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev: refuse to process line when invalid program output is obtained
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 15 Dec 2021 22:49:18 +0000 (07:49 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 25 Dec 2021 06:13:19 +0000 (15:13 +0900)
src/udev/udev-rules.c

index a610dea0d975a655a35e9e425b926ee825637f24..836a7789fb785473f6a77148c667f64c03cc7050 100644 (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;