[PATCH] wininet: NULL-terminate url string passed to InternetCrackUrlW from InternetCrackUrlA

Juan Lang juan.lang at gmail.com
Fri Oct 5 09:56:01 CDT 2007


Hi Nigel,
+  lpwszUrl=HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(WCHAR)*(nLength+1));
+  MultiByteToWideChar(CP_ACP,0,lpszUrl,dwUrlLength,lpwszUrl,(nLength+1));
+  lpwszUrl[nLength] = 0;

The last line is redundant:  the HeapAlloc already zeroes the buffer.
Though since MultiByteToWideChar is already overwriting the buffer,
you might remove the HEAP_ZERO_MEMORY and leave this assignment.
--Juan



More information about the wine-devel mailing list