chiark / gitweb /
udev: properly detect reference to unexisting part of PROGRAM's result
authorLukas Nykryn <lnykryn@redhat.com>
Mon, 24 Feb 2014 16:06:21 +0000 (17:06 +0100)
committerKay Sievers <kay@vrfy.org>
Tue, 11 Mar 2014 12:18:13 +0000 (13:18 +0100)
src/udev/udev-event.c

index 0b3ade0..5998be2 100644 (file)
@@ -254,6 +254,8 @@ subst:
                                                 cpos++;
                                         while (isspace(cpos[0]))
                                                 cpos++;
+                                        if (cpos[0] == '\0')
+                                                break;
                                 }
                                 if (i > 0) {
                                         log_error("requested part of result string not found");