SHELL32: fix a buffer overrun in autocomplete

Mike McCormack mike at codeweavers.com
Fri Jul 2 19:01:18 CDT 2004


ChangeLog:
* fix a buffer overrun in autocomplete
-------------- next part --------------
Index: dlls/shell32/autocomplete.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/autocomplete.c,v
retrieving revision 1.4
diff -u -r1.4 autocomplete.c
--- dlls/shell32/autocomplete.c	2 May 2004 04:20:23 -0000	1.4
+++ dlls/shell32/autocomplete.c	3 Jul 2004 00:57:31 -0000
@@ -562,7 +562,7 @@
 
 	    HeapFree(GetProcessHeap(), 0, This->txtbackup);
 	    This->txtbackup = (WCHAR*) HeapAlloc(GetProcessHeap(),
-						 HEAP_ZERO_MEMORY, lstrlenW(hwndText)*sizeof(WCHAR));							      
+						 HEAP_ZERO_MEMORY, (lstrlenW(hwndText)+1)*sizeof(WCHAR));							      
 	    lstrcpyW(This->txtbackup, hwndText);
 
 	    /* Returns if there is no text to search and we doesn't want to display all the entries */


More information about the wine-patches mailing list