anitazha / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone
Blob Blame History Raw
From 2e13dee991178518480d68e89d323666b047d182 Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Mon, 24 Feb 2014 17:06:21 +0100
Subject: [PATCH] udev: properly detect reference to unexisting part of
 PROGRAM's result

(cherry-picked from 66390abefae6530981446970ffd7ff4d1085e254)

Resolves: #1147524
---
 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 d69d7ba..aa7c793 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\n");