Thomas Faber : netapi32: Correctly reallocate buffer in NetWkstaUserGetInfo.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Sep 1 08:56:04 CDT 2015


Module: wine
Branch: master
Commit: 7164fde439211b0b9c66e15cb9db4af41d815d4e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7164fde439211b0b9c66e15cb9db4af41d815d4e

Author: Thomas Faber <thomas.faber at reactos.org>
Date:   Mon Aug 31 20:31:26 2015 +0200

netapi32: Correctly reallocate buffer in NetWkstaUserGetInfo.

---

 dlls/netapi32/netapi32.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dlls/netapi32/netapi32.c b/dlls/netapi32/netapi32.c
index 785a8d6..d7af2e0 100644
--- a/dlls/netapi32/netapi32.c
+++ b/dlls/netapi32/netapi32.c
@@ -1627,7 +1627,12 @@ NET_API_STATUS WINAPI NetWkstaUserGetInfo(LMSTR reserved, DWORD level,
                 (lstrlenW(ui->wkui0_username) + 1) * sizeof(WCHAR),
                 (LPVOID *) bufptr);
             if (nastatus != NERR_Success)
+            {
+                NetApiBufferFree(ui);
                 return nastatus;
+            }
+            ui = (PWKSTA_USER_INFO_0) *bufptr;
+            ui->wkui0_username = (LMSTR) (*bufptr + sizeof(WKSTA_USER_INFO_0));
         }
         break;
     }




More information about the wine-cvs mailing list