diff --git "a/dll/win32/advapi32/reg/reg.c" "b/dll/win32/advapi32/reg/reg.c" index 904ca010eca..4ec0df92139 100644 --- "a/dll/win32/advapi32/reg/reg.c" +++ "b/dll/win32/advapi32/reg/reg.c" @@ -1108,6 +1108,12 @@ RegCreateKeyExW( TRACE("RegCreateKeyExW() called\n"); + if (lpSecurityAttributes && lpSecurityAttributes->nLength == 0) + { + lpSecurityAttributes = NULL; + ERR("lpSecurityAttributes->nLength was 0.\n"); + } + if (lpSecurityAttributes && lpSecurityAttributes->nLength != sizeof(SECURITY_ATTRIBUTES)) return ERROR_INVALID_USER_BUFFER;