summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-message.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-02-01 00:08:32 +0000
committerHavoc Pennington <hp@redhat.com>2003-02-01 00:08:32 +0000
commitca84a292179f520df8e2c44a02d285ded95803ff (patch)
treebbb4e81703260e950d5ede9e9949643a415bf1c7 /dbus/dbus-message.c
parent0ff552a2c5c542a1be9a1c73597c298e6ece358f (diff)
2003-01-31 Havoc Pennington <hp@pobox.com>
* doc/dbus-specification.sgml: work on the specification * dbus/dbus-message.c (_dbus_message_loader_return_buffer): check the protocol version of the message. * dbus/dbus-protocol.h: drop special _REPLY names, the spec no longer specifies that. (DBUS_SERVICE_REPLY_SERVICE_EXISTS): fix flags (1/2/4/8 not 1/2/3/4) * dbus/dbus-marshal.c (_dbus_marshal_get_arg_end_pos): add missing "break" for DBUS_TYPE_NIL, remove @todo
Diffstat (limited to 'dbus/dbus-message.c')
-rw-r--r--dbus/dbus-message.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/dbus/dbus-message.c b/dbus/dbus-message.c
index 7875d90e..66c6bd59 100644
--- a/dbus/dbus-message.c
+++ b/dbus/dbus-message.c
@@ -2037,6 +2037,14 @@ _dbus_message_loader_return_buffer (DBusMessageLoader *loader,
_dbus_string_get_const_data_len (&loader->data, &header_data, 0, 16);
_dbus_assert (_DBUS_ALIGN_ADDRESS (header_data, 4) == header_data);
+
+ if (header_data[2] != DBUS_MAJOR_PROTOCOL_VERSION)
+ {
+ _dbus_verbose ("Message has protocol version %d ours is %d\n",
+ (int) header_data[2], DBUS_MAJOR_PROTOCOL_VERSION);
+ loader->corrupted = TRUE;
+ return;
+ }
byte_order = header_data[0];