advapi32: Fixed NULL ptr deref in QueryServiceConfig2A (Coverity).
This commit is contained in:
parent
0aa5a83688
commit
45a1269013
|
@ -1365,9 +1365,10 @@ BOOL WINAPI QueryServiceConfig2A(SC_HANDLE hService, DWORD dwLevel, LPBYTE buffe
|
||||||
|
|
||||||
switch(dwLevel) {
|
switch(dwLevel) {
|
||||||
case SERVICE_CONFIG_DESCRIPTION:
|
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;
|
LPSERVICE_DESCRIPTIONW configW = (LPSERVICE_DESCRIPTIONW) bufferW;
|
||||||
if (configW->lpDescription) {
|
if (configW->lpDescription && (size > sizeof(SERVICE_DESCRIPTIONA))) {
|
||||||
DWORD sz;
|
DWORD sz;
|
||||||
configA->lpDescription = (LPSTR)(configA + 1);
|
configA->lpDescription = (LPSTR)(configA + 1);
|
||||||
sz = WideCharToMultiByte( CP_ACP, 0, configW->lpDescription, -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;
|
else configA->lpDescription = NULL;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
FIXME("conversation W->A not implemented for level %d\n", dwLevel);
|
FIXME("conversation W->A not implemented for level %d\n", dwLevel);
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
|
Loading…
Reference in New Issue