mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
make sure the length is >= the data we're reading before we read it. hoping to fix 382713. r=roc
This commit is contained in:
parent
6a1badf022
commit
cab0f40712
@ -182,13 +182,14 @@ ReadCMAPTableFormat12(PRUint8 *aBuf, PRInt32 aLength, FontEntry *aFontEntry)
|
||||
GroupOffsetStartCode = 0,
|
||||
GroupOffsetEndCode = 4
|
||||
};
|
||||
NS_ENSURE_TRUE(aLength >= 16, NS_ERROR_FAILURE);
|
||||
|
||||
NS_ENSURE_TRUE(ReadShortAt(aBuf, OffsetFormat) == 12, NS_ERROR_FAILURE);
|
||||
NS_ENSURE_TRUE(ReadShortAt(aBuf, OffsetReserved) == 0, NS_ERROR_FAILURE);
|
||||
|
||||
PRUint32 tablelen = ReadLongAt(aBuf, OffsetTableLength);
|
||||
NS_ENSURE_TRUE(tablelen <= aLength, NS_ERROR_FAILURE);
|
||||
NS_ENSURE_TRUE(tablelen > 16, NS_ERROR_FAILURE);
|
||||
NS_ENSURE_TRUE(tablelen >= 16, NS_ERROR_FAILURE);
|
||||
|
||||
NS_ENSURE_TRUE(ReadLongAt(aBuf, OffsetLanguage) == 0, NS_ERROR_FAILURE);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user