From ea2507f461bb8401723e7233fe65509d009d125e Mon Sep 17 00:00:00 2001 From: Bruno Jesus <00cpxxx@gmail.com> Date: Sat, 21 Mar 2015 01:18:40 -0300 Subject: [PATCH] netapi32: Return an empty comment instead of NULL pointer in NetServerGetInfo. --- dlls/netapi32/netapi32.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/netapi32/netapi32.c b/dlls/netapi32/netapi32.c index f7701e38777..f9bfb48f9a8 100644 --- a/dlls/netapi32/netapi32.c +++ b/dlls/netapi32/netapi32.c @@ -1042,7 +1042,8 @@ NET_API_STATUS WINAPI NetServerGetInfo(LMSTR servername, DWORD level, LPBYTE* bu GetComputerNameW(computerName, &computerNameLen); computerNameLen++; /* include NULL terminator */ - size = sizeof(SERVER_INFO_101) + computerNameLen * sizeof(WCHAR); + /* Plus 1 for empty comment */ + size = sizeof(SERVER_INFO_101) + (computerNameLen + 1) * sizeof(WCHAR); ret = NetApiBufferAllocate(size, (LPVOID *)bufptr); if (ret == NERR_Success) { @@ -1060,7 +1061,9 @@ NET_API_STATUS WINAPI NetServerGetInfo(LMSTR servername, DWORD level, LPBYTE* bu info->sv101_version_minor = verInfo.dwMinorVersion; /* Use generic type as no wine equivalent of DC / Server */ info->sv101_type = SV_TYPE_NT; - info->sv101_comment = NULL; + info->sv101_comment = (LMSTR)(*bufptr + sizeof(SERVER_INFO_101) + + computerNameLen * sizeof(WCHAR)); + info->sv101_comment[0] = '\0'; } break; }