Comment 11 for bug 192218

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

The upstream patch seems to make sense since we have this in get_current_workarea():
    unsigned char *prop_return;
    uint32 *return_words;
    ...
    return_words = (uint32 *) prop_return;

uint32 is defined in rdesktop's types.h to be:
    typedef unsigned int uint32;

On 32 bit:
unsigned char *: 4
unsigned int: 4

But this results in mismatched sizes on 64 bit:
unsigned char *: 8
unsigned int: 4

get_current_workarea() sets prop_return via get_property_value(..., &prop_return, ...) which calls XGetWindowProperty(..., prop_return), and the man page of XGetWindowProperty shows this as an unsigned char **prop_return. Therefore, when it is set on 64 bit it can be as big as 8.

Since sizeof(long *) is 8 on 64 bit, this patch should fix the issue there. sizeof(long *) is 4 on 32 bit, so nothing should change on 32 bit (since sizeof(unsigned char *) is also 4).