Commit 30217ff0 authored by Paul Eggert's avatar Paul Eggert
Browse files

* dbusbind.c (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.

parent 2d1fc3c7
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
(Fdbus_method_error_internal): Likewise. Also, for unsigned (Fdbus_method_error_internal): Likewise. Also, for unsigned
arguments, check that Lisp number is nonnegative, rather than arguments, check that Lisp number is nonnegative, rather than
silently wrapping negative numbers around. silently wrapping negative numbers around.
(xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
* data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT. * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
......
...@@ -1663,7 +1663,9 @@ xd_read_message_1 (DBusConnection *connection, Lisp_Object bus) ...@@ -1663,7 +1663,9 @@ xd_read_message_1 (DBusConnection *connection, Lisp_Object bus)
DBusMessage *dmessage; DBusMessage *dmessage;
DBusMessageIter iter; DBusMessageIter iter;
unsigned int dtype; unsigned int dtype;
int mtype, serial; int mtype;
dbus_uint32_t serial;
unsigned int userial;
const char *uname, *path, *interface, *member; const char *uname, *path, *interface, *member;
dmessage = dbus_connection_pop_message (connection); dmessage = dbus_connection_pop_message (connection);
...@@ -1692,7 +1694,7 @@ xd_read_message_1 (DBusConnection *connection, Lisp_Object bus) ...@@ -1692,7 +1694,7 @@ xd_read_message_1 (DBusConnection *connection, Lisp_Object bus)
/* Read message type, message serial, unique name, object path, /* Read message type, message serial, unique name, object path,
interface and member from the message. */ interface and member from the message. */
mtype = dbus_message_get_type (dmessage); mtype = dbus_message_get_type (dmessage);
serial = userial = serial =
((mtype == DBUS_MESSAGE_TYPE_METHOD_RETURN) ((mtype == DBUS_MESSAGE_TYPE_METHOD_RETURN)
|| (mtype == DBUS_MESSAGE_TYPE_ERROR)) || (mtype == DBUS_MESSAGE_TYPE_ERROR))
? dbus_message_get_reply_serial (dmessage) ? dbus_message_get_reply_serial (dmessage)
...@@ -1702,7 +1704,7 @@ xd_read_message_1 (DBusConnection *connection, Lisp_Object bus) ...@@ -1702,7 +1704,7 @@ xd_read_message_1 (DBusConnection *connection, Lisp_Object bus)
interface = dbus_message_get_interface (dmessage); interface = dbus_message_get_interface (dmessage);
member = dbus_message_get_member (dmessage); member = dbus_message_get_member (dmessage);
XD_DEBUG_MESSAGE ("Event received: %s %d %s %s %s %s %s", XD_DEBUG_MESSAGE ("Event received: %s %u %s %s %s %s %s",
(mtype == DBUS_MESSAGE_TYPE_INVALID) (mtype == DBUS_MESSAGE_TYPE_INVALID)
? "DBUS_MESSAGE_TYPE_INVALID" ? "DBUS_MESSAGE_TYPE_INVALID"
: (mtype == DBUS_MESSAGE_TYPE_METHOD_CALL) : (mtype == DBUS_MESSAGE_TYPE_METHOD_CALL)
...@@ -1712,7 +1714,7 @@ xd_read_message_1 (DBusConnection *connection, Lisp_Object bus) ...@@ -1712,7 +1714,7 @@ xd_read_message_1 (DBusConnection *connection, Lisp_Object bus)
: (mtype == DBUS_MESSAGE_TYPE_ERROR) : (mtype == DBUS_MESSAGE_TYPE_ERROR)
? "DBUS_MESSAGE_TYPE_ERROR" ? "DBUS_MESSAGE_TYPE_ERROR"
: "DBUS_MESSAGE_TYPE_SIGNAL", : "DBUS_MESSAGE_TYPE_SIGNAL",
serial, uname, path, interface, member, userial, uname, path, interface, member,
SDATA (format2 ("%s", args, Qnil))); SDATA (format2 ("%s", args, Qnil)));
if ((mtype == DBUS_MESSAGE_TYPE_METHOD_RETURN) if ((mtype == DBUS_MESSAGE_TYPE_METHOD_RETURN)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment