Signed-off-by: Gijs Vermeulen gijsvrm@gmail.com --- dlls/advapi32/advapi.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/dlls/advapi32/advapi.c b/dlls/advapi32/advapi.c index cfd79e02af..735b1db7c3 100644 --- a/dlls/advapi32/advapi.c +++ b/dlls/advapi32/advapi.c @@ -48,6 +48,7 @@ BOOL WINAPI GetUserNameA( LPSTR name, LPDWORD size ) BOOL ret;
if (!len) return FALSE; + if (len > *size) SetLastError(ERROR_INSUFFICIENT_BUFFER); if ((ret = (len < *size))) len++; *size = len; return ret; @@ -63,6 +64,7 @@ BOOL WINAPI GetUserNameW( LPWSTR name, LPDWORD size ) BOOL ret;
if (!len) return FALSE; + if (len > *size) SetLastError(ERROR_INSUFFICIENT_BUFFER); if ((ret = (len < *size))) len++; *size = len; return ret;