diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2011-05-24 19:41:00 +0100 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2011-05-24 19:55:31 +0100 |
commit | 5bfe3ede2c17b7dd10d258e5661892967cabcc60 (patch) | |
tree | bc9e93657ea6d18360d7b64de3c58a1df21c09f3 | |
parent | 9b81db6ba12edb6e5c8f9b901f83b9a92d9e23fa (diff) |
Explicitly cast to guint64 when passing varargs
Without any additional type information, integers used in varargs lists
can get passed as the wrong type. In this call to tp_value_array_build()
in gabble_muc_channel_constructed(), we should be passing 0 as a a
gint64, but I think in practice we're passing it as a pointer-sized
thing. (I'm not a C language lawyer, I'm sure someone could correct me
on this.) If the type we're passing it as is not the same size as a
gint64, this will cause tp_value_array_build() to read off the end of
its varargs, probably crashing in the process (because what it reads
will probably not be a valid GType).
The other call to tp_value_array_build() added in ec8ca6e (for the Room
interface) does cast correctly.
Fixes: <https://bugs.freedesktop.org/show_bug.cgi?id=37165>
Reviewed-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r-- | src/muc-channel.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/muc-channel.c b/src/muc-channel.c index 2880ad475..66f4355a9 100644 --- a/src/muc-channel.c +++ b/src/muc-channel.c @@ -508,7 +508,7 @@ gabble_muc_channel_constructed (GObject *obj) priv->subject = tp_value_array_build (3, G_TYPE_STRING, "", G_TYPE_STRING, "", - G_TYPE_INT64, 0, + G_TYPE_INT64, (gint64) 0, G_TYPE_INVALID); if (priv->invited) |