chiark / gitweb /
bus: properly handle empty messages
[elogind.git] / src / libsystemd-bus / bus-message.c
index 4488e7b6b37115cc4597aa97ad750542c435446e..9e712717cc34b31864af3e5d97953cc52dac2539 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;