Hi Uli,

Sorry for the delay.

At 1242329343 time_t, Uli Schlachter wrote:
> Subject: [PATCH 1/2] Restructure the code in ewmh_window_icon_from_reply() 
> slightly

Ack.

> Subject: [PATCH 2/2] Check that the property is as long as it should be
> +    unsigned long long len;

NEIN!

Never ever use this fucking type inside awesome, please. It's just a
pain to known which size it will have on every arch in the world. We get
ride of them with Xlib gone, good riddance. And XCB has a sane behaviour
using stdint so let's use them.
If you are checking for CARD32, the corresponding type is uint32_t.

> +    /* Check that the property is as long as it should be, handling integer
> +     * overflow. unsigned long long got at least 64 bit and thus this
> +     * multiplication can not overflow.
> +     */

Well you can use uint64_t.

> +    len = data[0] * (unsigned long long) data[1];
> +    if (!data[0] || !data[1] || len > r->length - 2) {
> +        /* TODO remove this warning */
> +        warn("Ignoring invalid icon");
> +        return 0;
> +    }
> +

Yeah, remove it. ;-)

Cheers,
-- 
Julien Danjou
// ᐰ <[email protected]>   http://julien.danjou.info
// 9A0D 5FD9 EB42 22F6 8974  C95C A462 B51E C2FE E5CD
// I'm no superman.

Attachment: signature.asc
Description: Digital signature

Reply via email to