1 Jun
2020
1 Jun
'20
12:25 p.m.
Vijay Kiran Kamuju <infyquest(a)gmail.com> wrote:
+int WINAPI GetHostNameW(PWSTR name, int namelen) +{ + char *nameA = NULL;
Initialization to NULL is redundant.
+ int ret; + + TRACE("name %p, len %d\n", name, namelen); + + if (!name) + { + SetLastError(WSAEFAULT); + return SOCKET_ERROR; + } + if (name && (!(nameA = HeapAlloc(GetProcessHeap(), 0, namelen))))
'name' can't be NULL at this point. 'namelen' for a multibyte string could be longer than length for a unicode one. -- Dmitry.