chiark / gitweb /
bus: fix parsing of matches against empty strings
authorLennart Poettering <lennart@poettering.net>
Thu, 12 Dec 2013 20:25:31 +0000 (21:25 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 13 Dec 2013 03:06:43 +0000 (04:06 +0100)
src/libsystemd-bus/bus-match.c

index f7fca5f..342819d 100644 (file)
@@ -755,6 +755,14 @@ int bus_match_parse(
                         escaped = false;
                 }
 
+                if (!value) {
+                        value = strdup("");
+                        if (!value) {
+                                r = -ENOMEM;
+                                goto fail;
+                        }
+                }
+
                 if (t == BUS_MATCH_MESSAGE_TYPE) {
                         r = bus_message_type_from_string(value, &u);
                         if (r < 0)