2
1

0003-Reduce-maximum-recursion-depth-in-exif_data_load_dat.patch 1017 B

123456789101112131415161718192021222324252627282930
  1. From 5d28011c40ec86cf52cffad541093d37c263898a Mon Sep 17 00:00:00 2001
  2. From: Dan Fandrich <dan@coneharvesters.com>
  3. Date: Fri, 20 Apr 2018 18:05:19 +0200
  4. Subject: [PATCH] Reduce maximum recursion depth in exif_data_load_data_content
  5. This only needs to be a small, single digit integer for normal files,
  6. and reducing the maximum closer to this reduces the time and space
  7. needed to detect pathological cases.
  8. Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
  9. ---
  10. libexif/exif-data.c | 2 +-
  11. 1 file changed, 1 insertion(+), 1 deletion(-)
  12. diff --git a/libexif/exif-data.c b/libexif/exif-data.c
  13. index 91f4c33..04cdda2 100644
  14. --- a/libexif/exif-data.c
  15. +++ b/libexif/exif-data.c
  16. @@ -378,7 +378,7 @@ exif_data_load_data_content (ExifData *data, ExifIfd ifd,
  17. if ((((int)ifd) < 0) || ( ((int)ifd) >= EXIF_IFD_COUNT))
  18. return;
  19. - if (recursion_depth > 30) {
  20. + if (recursion_depth > 12) {
  21. exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData",
  22. "Deep recursion detected!");
  23. return;
  24. --
  25. 2.20.1