Skip to content

Commit

Permalink
Fixed Heap out of bound read in mysofa2json #78
Browse files Browse the repository at this point in the history
  • Loading branch information
hoene committed Sep 7, 2019
1 parent 90e7bfd commit af9bbed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hdf/fractalhead.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static int directblockRead(struct READER *reader, struct DATAOBJECT *dataobject,
typeandversion = (uint8_t) fgetc(reader->fhd);
offset = readValue(reader, offset_size);
length = readValue(reader, length_size);
if (offset > 0x10000000 || length > 0x10000000)
if (offset > 0x10000000 || length > 0x10000000 || length == 0)
return MYSOFA_UNSUPPORTED_FORMAT;

log(" %d %4" PRIX64 " %" PRIX64 "%08lX\n",typeandversion,offset,length,ftell(reader->fhd));
Expand Down

0 comments on commit af9bbed

Please sign in to comment.