chiark / gitweb /
bus: properly handle empty messages
authorLennart Poettering <lennart@poettering.net>
Tue, 10 Dec 2013 02:30:51 +0000 (03:30 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 10 Dec 2013 02:30:51 +0000 (03:30 +0100)
src/libsystemd-bus/bus-message.c

index 4488e7b..9e71271 100644 (file)
@@ -3061,7 +3061,7 @@ static int message_peek_body(
         }
 
         part = find_part(m, start, nbytes, (void**) &q);
-        if (!part || !q)
+        if (!part || (nbytes > 0 && !q))
                 return -EBADMSG;
 
         *rindex = end;