Add a failsafe on the maximum number of Canon MakerNote subtags.
authorDan Fandrich <dan@coneharvesters.com>
Sat, 16 May 2020 17:32:30 +0000 (19:32 +0200)
committerMarcus Meissner <meissner@suse.de>
Sat, 16 May 2020 17:32:30 +0000 (19:32 +0200)
commite6a38a1a23ba94d139b1fa2cd4519fdcfe3c9bab
treeb5f60dc2836440b014f8a0d6687658c1d1001406
parentbbd35b1f591b960575d8c77921f93cbedfd69e7d
Add a failsafe on the maximum number of Canon MakerNote subtags.

A malicious file could be crafted to cause extremely large values in some
tags without tripping any buffer range checks.  This is bad with the libexif
representation of Canon MakerNotes because some arrays are turned into
individual tags that the application must loop around.

The largest value I've seen for failsafe_size in a (very small) sample of valid
Canon files is <5000.  The limit is set two orders of magnitude larger to avoid
tripping up falsely in case some models use much larger values.

Patch from Google.

CVE-2020-13114
libexif/canon/exif-mnote-data-canon.c