On 19 January 2015 at 14:09, Virgile Andreani
<virgile.andre...@anbuco.fr> wrote:
> Using sselp on a string longer than BUFSIZ currently leads to a
> crash.  The reason is that on line 38 of `sselp.c`, `off` should
> not be incremented by the length of a chunk but by `len/4`.
> Indeed, incrementing `off` by 1 skips four characters, not one.
>
> Here is the relevant section of the manpage of XGetWindowProperty:
>
>>       N = actual length of the stored property in bytes
>>           (even if the format is 16 or 32)
>>       I = 4 * long_offset
>>       T = N - I
>>       L = MINIMUM(T, 4 * long_length)
>>       A = N - (I + L)
>>
>> The returned value starts at byte index I in the property
>> (indexing from zero), and its length in bytes is L.
>
> Hence the patch, replacing `len` with `len/4`.

Thanks for spotting. Applied.

BR,
Anselm

Reply via email to