Skip to content

Commit

Permalink
reduce limit of pentax makernotes to 200. (we know of 102 at this tim…
Browse files Browse the repository at this point in the history
…e) ...
  • Loading branch information
msmeissn committed Mar 15, 2021
1 parent b5b16fb commit 977d8ff
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libexif/pentax/exif-mnote-data-pentax.c
Expand Up @@ -265,6 +265,14 @@ exif_mnote_data_pentax_load (ExifMnoteData *en,
c = exif_get_short (buf + datao, n->order);
datao += 2;

/* Just use an arbitrary max tag limit here to avoid needing to much memory or time. There are 102 named tags currently.
* The format allows specifying the same range of memory as often as it can, so this multiplies quickly. */
if (c > 200) {
exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteDataPentax", "Too much tags (%d) in Pentax MakerNote", c);
return;
}


/* Remove any old entries */
exif_mnote_data_pentax_clear (n);

Expand Down

0 comments on commit 977d8ff

Please sign in to comment.