mirror of
https://github.com/reactos/reactos.git
synced 2024-07-11 23:25:09 +00:00
[gdi32] Prevent possible buffer overrun in TranslateCharsetInfo, see wine bug 19819 for more info
svn path=/trunk/; revision=43655
This commit is contained in:
parent
64b8e965ef
commit
59245c6725
|
@ -1724,13 +1724,13 @@ 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 a new issue