[PATCH] dlls/shell32: always allocate a whole ITEMIDLIST structure

Eric Pouech eric.pouech at gmail.com
Thu Mar 24 04:13:26 CDT 2022


Partially allocating a structure generates -Warray-bounds warnings with
GCC11
In this specific case, given the rounding in memory allocators,
would even not increase the effective allocated size

Signed-off-by: Eric Pouech <eric.pouech at gmail.com>

---
 dlls/shell32/pidl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/shell32/pidl.c b/dlls/shell32/pidl.c
index 4c66a14c700..f9c91a79132 100644
--- a/dlls/shell32/pidl.c
+++ b/dlls/shell32/pidl.c
@@ -1574,7 +1574,7 @@ LPITEMIDLIST _ILCreateDesktop(void)
     LPITEMIDLIST ret;
 
     TRACE("()\n");
-    ret = SHAlloc(2);
+    ret = SHAlloc(sizeof(*ret));
     if (ret)
         ret->mkid.cb = 0;
     return ret;




More information about the wine-devel mailing list