Bruno Jesus : netapi32: Return an empty comment instead of NULL pointer in NetServerGetInfo.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Mar 23 10:03:18 CDT 2015
Module: wine
Branch: master
Commit: ea2507f461bb8401723e7233fe65509d009d125e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=ea2507f461bb8401723e7233fe65509d009d125e
Author: Bruno Jesus <00cpxxx at gmail.com>
Date: Sat Mar 21 01:18:40 2015 -0300
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 f7701e3..f9bfb48 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;
}
More information about the wine-cvs
mailing list