mirror of
https://github.com/simon987/antiword.git
synced 2025-12-14 12:39:01 +00:00
Add check for buffer overflow with malformed input files
This commit is contained in:
@@ -259,6 +259,10 @@ bGetPPS(FILE *pFile,
|
|||||||
}
|
}
|
||||||
tNameSize = (size_t)usGetWord(0x40, aucBytes);
|
tNameSize = (size_t)usGetWord(0x40, aucBytes);
|
||||||
tNameSize = (tNameSize + 1) / 2;
|
tNameSize = (tNameSize + 1) / 2;
|
||||||
|
if ( tNameSize > sizeof(atPPSlist[iIndex].szName)) {
|
||||||
|
werr(0, "Name Size of PPS %d is too large", iIndex);
|
||||||
|
tNameSize = sizeof(atPPSlist[iIndex].szName);
|
||||||
|
}
|
||||||
vName2String(atPPSlist[iIndex].szName, aucBytes, tNameSize);
|
vName2String(atPPSlist[iIndex].szName, aucBytes, tNameSize);
|
||||||
atPPSlist[iIndex].ucType = ucGetByte(0x42, aucBytes);
|
atPPSlist[iIndex].ucType = ucGetByte(0x42, aucBytes);
|
||||||
if (atPPSlist[iIndex].ucType == 5) {
|
if (atPPSlist[iIndex].ucType == 5) {
|
||||||
|
|||||||
Reference in New Issue
Block a user