Commit 45a12690 authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

advapi32: Fixed NULL ptr deref in QueryServiceConfig2A (Coverity).

parent 0aa5a836
......@@ -1365,9 +1365,10 @@ BOOL WINAPI QueryServiceConfig2A(SC_HANDLE hService, DWORD dwLevel, LPBYTE buffe
switch(dwLevel) {
case SERVICE_CONFIG_DESCRIPTION:
{ LPSERVICE_DESCRIPTIONA configA = (LPSERVICE_DESCRIPTIONA) buffer;
if (buffer && bufferW) {
LPSERVICE_DESCRIPTIONA configA = (LPSERVICE_DESCRIPTIONA) buffer;
LPSERVICE_DESCRIPTIONW configW = (LPSERVICE_DESCRIPTIONW) bufferW;
if (configW->lpDescription) {
if (configW->lpDescription && (size > sizeof(SERVICE_DESCRIPTIONA))) {
DWORD sz;
configA->lpDescription = (LPSTR)(configA + 1);
sz = WideCharToMultiByte( CP_ACP, 0, configW->lpDescription, -1,
......@@ -1380,10 +1381,11 @@ BOOL WINAPI QueryServiceConfig2A(SC_HANDLE hService, DWORD dwLevel, LPBYTE buffe
}
else configA->lpDescription = NULL;
}
break;
break;
default:
FIXME("conversation W->A not implemented for level %d\n", dwLevel);
ret = FALSE;
break;
}
cleanup:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment