[NTGDI] Fix stack memory disclosure in ftGdiGetTextMetricsW (#2991)

This commit is contained in:
Nguyen Trung Khanh 2020-08-25 23:28:39 +07:00 committed by GitHub
parent a081e12fbd
commit 247c189263
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4560,6 +4560,7 @@ ftGdiGetTextMetricsW(
EngSetLastError(STATUS_INVALID_PARAMETER);
return FALSE;
}
RtlZeroMemory(ptmwi, sizeof(TMW_INTERNAL));
if (!(dc = DC_LockDc(hDC)))
{
@ -4612,7 +4613,6 @@ ftGdiGetTextMetricsW(
FillTM(&ptmwi->TextMetric, FontGDI, pOS2, pHori, !Error ? &Win : 0);
/* FIXME: Fill Diff member */
RtlZeroMemory(&ptmwi->Diff, sizeof(ptmwi->Diff));
}
IntUnLockFreeType();