gdi32: Prevent possible buffer overrun.
This commit is contained in:
parent
975a93de68
commit
dd0a7078e0
|
@ -2596,13 +2596,13 @@ BOOL WINAPI TranslateCharsetInfo(
|
|||
int index = 0;
|
||||
switch (flags) {
|
||||
case TCI_SRCFONTSIG:
|
||||
while (!(*lpSrc>>index & 0x0001) && index<MAXTCIINDEX) index++;
|
||||
while (index < MAXTCIINDEX && !(*lpSrc>>index & 0x0001)) index++;
|
||||
break;
|
||||
case TCI_SRCCODEPAGE:
|
||||
while (PtrToUlong(lpSrc) != FONT_tci[index].ciACP && index < MAXTCIINDEX) index++;
|
||||
while (index < MAXTCIINDEX && PtrToUlong(lpSrc) != FONT_tci[index].ciACP) index++;
|
||||
break;
|
||||
case TCI_SRCCHARSET:
|
||||
while (PtrToUlong(lpSrc) != FONT_tci[index].ciCharset && index < MAXTCIINDEX) index++;
|
||||
while (index < MAXTCIINDEX && PtrToUlong(lpSrc) != FONT_tci[index].ciCharset) index++;
|
||||
break;
|
||||
default:
|
||||
return FALSE;
|
||||
|
|
Loading…
Reference in New Issue