gio: Prevent hang writing to a large GMemoryBuffer
authorRoss Lagerwall <rosslagerwall@gmail.com>
Wed, 29 Oct 2014 22:12:39 +0000 (22:12 +0000)
committerRoss Lagerwall <rosslagerwall@gmail.com>
Thu, 30 Oct 2014 20:15:47 +0000 (20:15 +0000)
commit226c292b6ab95014648e9fc0a082bb6c26eeccc8
tree32e6d2ae33ba87e6d8c11888ee95d54867ec2dac
parent5a6f13d16f38ea0a6c9d48332b7e3932b7f3b7d4
gio: Prevent hang writing to a large GMemoryBuffer

Fix a hang due to overflow by using unsigned numbers and explicitly
checking if the number overflows to zero.  This also fixes the previous
logic which assigned an int which may be negative to an unsigned number
resulting in sign extension and strange results.

Use gsize rather than int to allow for large buffers on 64 bit machines.

https://bugzilla.gnome.org/show_bug.cgi?id=727988
gio/gdbusmessage.c