undefined/exif_9286_user_comment.go: Validate for minimum user-notes size

for/master
Dustin Oprea 2020-05-02 16:24:00 -04:00
parent 45986dbda3
commit 80e3b12b98
1 changed files with 4 additions and 0 deletions

View File

@ -105,6 +105,10 @@ func (Codec9286UserComment) Decode(valueContext *exifcommon.ValueContext) (value
valueBytes, err := valueContext.ReadBytes()
log.PanicIf(err)
if len(valueBytes) < 8 {
return nil, ErrUnparseableValue
}
unknownUc := Tag9286UserComment{
EncodingType: TagUndefinedType_9286_UserComment_Encoding_UNDEFINED,
EncodingBytes: []byte{},