[PATCH] shell32: use flexible arrays to avoid fortify failures

Joerg-Cyril.Hoehle at t-systems.com Joerg-Cyril.Hoehle at t-systems.com
Mon Sep 20 07:24:52 CDT 2010


Alexandre Julliard wrote:
>> it needs to be "foo[]".  ANYSIZE_ARRAY is defined as 1
>True, you don't want to change the public one, but you can define a
>shell32-specific version of it. At least then it looks like a normal
>array declaration.

Thank you for pointing to ANYSIZE_ARRAY.

Why not cope with the way MS people recommend and use
foo[ANYSIZE_ARRAY], together with the FIELD_OFFSET() macro?
I found this article useful:
and made a note to use that in future patches.
It explains why ANYSIZE_ARRAY MUST be 1.

Should somebody submit patches to replace foo[1] with foo[ANYSIZE_ARRAY]
where needed in Wine's include/*.h ?
E.g. wingdi.h: BITMAPINFO comes to mind, it uses
    RGBQUAD          bmiColors[1];
ANYSIZE_ARRAY would be a perfect match here.

Perhaps one can teach fortify about ANYSIZE_ARRAY?

 Jörg Höhle

More information about the wine-devel mailing list