rwcarlsen / goexif

Decode embedded EXIF meta data from image files.
BSD 2-Clause "Simplified" License
627 stars 134 forks source link

newAppSec: be safer against bogus data length #35

Closed mpl closed 9 years ago

mpl commented 9 years ago

It can apparently happen (with at least one gimp .xcf file), that it has all the same markers as in a jpeg, up until reading the 2 bytes that would code for the data length. Since the data length is supposed to include those 2 bytes, the code was assuming that the value of data length would be always at least 3, and slicing under that assumption. Which breaks when e.g. an .xcf file encodes the value 1 on these 2 bytes.

Fixes #34

rwcarlsen commented 9 years ago

Thanks!