[PATCH] shell32: use flexible arrays to avoid fortify failures
Mike Frysinger
vapier at gentoo.org
Mon Sep 20 11:51:11 CDT 2010
On Monday, September 20, 2010 06:49:20 Alexandre Julliard wrote:
> Mike Frysinger writes:
> > On Sunday, September 19, 2010 17:17:53 Alexandre Julliard wrote:
> >> Mike Frysinger writes:
> >> > i dont see how that would help. the code is currently:
> >> > typedef struct ... {
> >> >
> >> > ...
> >> > CHAR foo[1];
> >> >
> >> > } ...;
> >> >
> >> > it needs to be "foo[]". ANYSIZE_ARRAY is defined as 1, so once the
> >> > preprocessor is done, we're right back where we started. i cant
> >> > change the value of ANYSIZE_ARRAY to nothing because some code uses
> >> > this define in multiplication to calculate the size of objects.
> >>
> >> 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.
> >
> > what do you mean by "public" ? the header i'm changing
> > (dlls/shell32/pidl.h) isnt exported during `make install` that i can
> > see. so only wine itself will be reading this header, and i think all
> > consumers of it internally should be getting "foo[]".
>
> Yes. My initial thought was that you could improve the global
> ANYSIZE_ARRAY, but as you pointed out that's not a good idea. What you
> should do then is define SHELL32_ANYSIZE_ARRAY in pidl.h, that you use
> only in pidl.h, and not touch the global headers at all.
well, i dont think this issue is limited to shell32. it's just the only one
to hit it atm. what about my other patch i posted ?
http://www.winehq.org/pipermail/wine-patches/2010-September/093377.html
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20100920/94bf21eb/attachment-0001.pgp>
More information about the wine-devel
mailing list