[systemd-devel] [PATCH] udev: properly detect reference to unexisting part of PROGRAM's result

Lukas Nykryn lnykryn at redhat.com
Mon Feb 24 08:06:21 PST 2014


---
 src/udev/udev-event.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c
index 0b3ade0..5998be2 100644
--- a/src/udev/udev-event.c
+++ b/src/udev/udev-event.c
@@ -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");
-- 
1.8.5.3



More information about the systemd-devel mailing list