From: Lennart Poettering Date: Thu, 12 Dec 2013 20:25:31 +0000 (+0100) Subject: bus: fix parsing of matches against empty strings X-Git-Tag: v209~961 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2c8d477a01cd154bbaab6c46a5ffeed3e55f1a6b;p=thirdparty%2Fsystemd.git bus: fix parsing of matches against empty strings --- diff --git a/src/libsystemd-bus/bus-match.c b/src/libsystemd-bus/bus-match.c index f7fca5f573d..342819d9c06 100644 --- a/src/libsystemd-bus/bus-match.c +++ b/src/libsystemd-bus/bus-match.c @@ -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)