diff -Nru libexif-0.6.21/debian/changelog libexif-0.6.21/debian/changelog --- libexif-0.6.21/debian/changelog 2020-06-08 14:55:38.000000000 +0000 +++ libexif-0.6.21/debian/changelog 2020-11-06 15:14:21.000000000 +0000 @@ -1,3 +1,12 @@ +libexif (0.6.21-6ubuntu0.4) focal-security; urgency=medium + + * SECURITY UPDATE: Buffer overflow + - debian/patches/CVE-2020-0452.patch: fixed a incorrect overflow check that could be + optimized away in libexif/exif-entry.c. + - CVE-2020-0452 + + -- Leonidas S. Barbosa Fri, 06 Nov 2020 12:14:21 -0300 + libexif (0.6.21-6ubuntu0.3) focal-security; urgency=medium * SECURITY UPDATE: Out of bounds read diff -Nru libexif-0.6.21/debian/patches/CVE-2020-0452.patch libexif-0.6.21/debian/patches/CVE-2020-0452.patch --- libexif-0.6.21/debian/patches/CVE-2020-0452.patch 1970-01-01 00:00:00.000000000 +0000 +++ libexif-0.6.21/debian/patches/CVE-2020-0452.patch 2020-11-06 15:14:10.000000000 +0000 @@ -0,0 +1,37 @@ +Backported of: + +From 9266d14b5ca4e29b970fa03272318e5f99386e06 Mon Sep 17 00:00:00 2001 +From: Marcus Meissner +Date: Thu, 5 Nov 2020 09:50:08 +0100 +Subject: [PATCH] fixed a incorrect overflow check that could be optimized + away. + +inspired by: +https://android.googlesource.com/platform/external/libexif/+/8e7345f3bc0bad06ac369d6cbc1124c8ceaf7d4b + +https://source.android.com/security/bulletin/2020-11-01 + +CVE-2020-0452 +Index: libexif-0.6.21/libexif/exif-entry.c +=================================================================== +--- libexif-0.6.21.orig/libexif/exif-entry.c ++++ libexif-0.6.21/libexif/exif-entry.c +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -1376,8 +1377,8 @@ exif_entry_get_value (ExifEntry *e, char + case EXIF_TAG_XP_KEYWORDS: + case EXIF_TAG_XP_SUBJECT: + { +- /* Sanity check the size to prevent overflow */ +- if (e->size+sizeof(unsigned short) < e->size) break; ++ /* Sanity check the size to prevent overflow. Note EXIF files are 64kb at most. */ ++ if (e->size >= 65536 - sizeof(uint16_t)*2) break; + + /* The tag may not be U+0000-terminated , so make a local + U+0000-terminated copy before converting it */ diff -Nru libexif-0.6.21/debian/patches/series libexif-0.6.21/debian/patches/series --- libexif-0.6.21/debian/patches/series 2020-06-08 14:55:38.000000000 +0000 +++ libexif-0.6.21/debian/patches/series 2020-11-06 15:14:10.000000000 +0000 @@ -16,3 +16,4 @@ CVE-2020-13114.patch CVE-2020-0182.patch CVE-2020-0198.patch +CVE-2020-0452.patch