[libvirt] [PATCH v2] Fix dbus message reading code on big endian hosts

Eric Blake eblake at redhat.com
Mon Jul 29 17:02:23 UTC 2013


On 07/29/2013 10:57 AM, Daniel P. Berrange wrote:

>>>          case DBUS_TYPE_UINT16:
>>> -            GET_NEXT_VAL(dbus_uint16_t, unsigned int, "%d");
>>> +            GET_NEXT_VAL(dbus_uint16_t, short unsigned, "%d");
>>
>> Works, but 'unsigned short' is a bit more typical.
> 
> Ok, will change it.
> 
>> ACK.
> 
> Waiting for Jiri to confirm that it builds on all other architectures
> before pushing.

The fix makes sense - on the put side, you pass 'short' to a var-args
function, which gets promoted to 'int', so the va_arg must grab the
value from the promoted type.  But on the get side, you pass 'short*' to
a var-args function, which is used as-is, and if you tell dbus to deref
an 'int*', that would explain the stack-smashing.  But yeah, waiting for
a build confirmation never hurts.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130729/5b4d07d7/attachment-0001.sig>


More information about the libvir-list mailing list