Eric Pouech : shell32: Always allocate a whole ITEMIDLIST structure.

Alexandre Julliard julliard at winehq.org
Mon Mar 28 15:53:40 CDT 2022


Module: wine
Branch: master
Commit: e62dd2a5b62a6a75d9bcaec29e80b31eb257c41d
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=e62dd2a5b62a6a75d9bcaec29e80b31eb257c41d

Author: Eric Pouech <eric.pouech at gmail.com>
Date:   Thu Mar 24 10:13:26 2022 +0100

shell32: Always allocate a whole ITEMIDLIST structure.

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>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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-cvs mailing list