Commit dd0a7078 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

gdi32: Prevent possible buffer overrun.

parent 975a93de
......@@ -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;
......
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