Skip to content

Commit

Permalink
Fixing bin/exiv2 -pR ~/Downloads/bugs/pngimage-heap-bof-poc-1.dms in #…
Browse files Browse the repository at this point in the history
  • Loading branch information
clanmills committed Dec 10, 2018
1 parent af7ca26 commit 4f9c912
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/pngimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,16 @@ namespace Exiv2 {

// decode the chunk
bool bGood = false;
if ( tEXt ) {
bGood = tEXtToDataBuf(data+name_l,dataOffset-name_l,dataBuf);
if ( dataOffset > name_l + 2 ) {
if ( tEXt ) {
bGood = tEXtToDataBuf(data + name_l, dataOffset - name_l, dataBuf);
}
if (zTXt || iCCP) {
bGood = zlibToDataBuf(data + name_l + 1, dataOffset - name_l - 1,
dataBuf); // +1 = 'compressed' flag
}
}

if ( zTXt || iCCP ) {
bGood = zlibToDataBuf(data+name_l+1,dataOffset-name_l-1,dataBuf); // +1 = 'compressed' flag
}
Expand Down

0 comments on commit 4f9c912

Please sign in to comment.