mirror of
https://github.com/reactos/reactos.git
synced 2024-08-03 01:50:57 +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;
|
int index = 0;
|
||||||
switch (flags) {
|
switch (flags) {
|
||||||
case TCI_SRCFONTSIG:
|
case TCI_SRCFONTSIG:
|
||||||
while (!(*lpSrc>>index & 0x0001) && index<MAXTCIINDEX) index++;
|
while (index < MAXTCIINDEX && !(*lpSrc>>index & 0x0001)) index++;
|
||||||
break;
|
break;
|
||||||
case TCI_SRCCODEPAGE:
|
case TCI_SRCCODEPAGE:
|
||||||
while (PtrToUlong(lpSrc) != FONT_tci[index].ciACP && index < MAXTCIINDEX) index++;
|
while (index < MAXTCIINDEX && PtrToUlong(lpSrc) != FONT_tci[index].ciACP) index++;
|
||||||
break;
|
break;
|
||||||
case TCI_SRCCHARSET:
|
case TCI_SRCCHARSET:
|
||||||
while (PtrToUlong(lpSrc) != FONT_tci[index].ciCharset && index < MAXTCIINDEX) index++;
|
while (index < MAXTCIINDEX && PtrToUlong(lpSrc) != FONT_tci[index].ciCharset) index++;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
Loading…
Reference in a new issue