Index: dbus/message.cc |
diff --git a/dbus/message.cc b/dbus/message.cc |
index aa9cc550e46ce792db8fdb1a4289d80fa7933865..2750cb187a08329d1e196c6d54817d41180ee54b 100644 |
--- a/dbus/message.cc |
+++ b/dbus/message.cc |
@@ -755,6 +755,12 @@ bool MessageReader::PopArrayOfBytes(uint8** bytes, size_t* length) { |
MessageReader array_reader(message_); |
if (!PopArray(&array_reader)) |
return false; |
+ // An empty array is allowed. |
+ if (!array_reader.HasMoreData()) { |
+ *length = 0; |
+ *bytes = NULL; |
+ return true; |
+ } |
if (!array_reader.CheckDataType(DBUS_TYPE_BYTE)) |
return false; |
int int_length = 0; |
@@ -762,7 +768,7 @@ bool MessageReader::PopArrayOfBytes(uint8** bytes, size_t* length) { |
bytes, |
&int_length); |
*length = static_cast<int>(int_length); |
- return bytes != NULL; |
+ return true; |
} |
bool MessageReader::PopArrayOfStrings( |