summaryrefslogtreecommitdiff
path: root/CVE-2020-0452.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-08-06 02:24:21 +0000
committerCoprDistGit <infra@openeuler.org>2024-08-06 02:24:21 +0000
commit27b38fac0b49d294273e54fc339043e772e03e12 (patch)
treed663956d14c93758652df96ba8dd7dd31583c3ff /CVE-2020-0452.patch
parent1a6e1b9026d84e4e77b9d94721fa7a07f10c03df (diff)
automatic import of libexifopeneuler24.03_LTS
Diffstat (limited to 'CVE-2020-0452.patch')
-rw-r--r--CVE-2020-0452.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/CVE-2020-0452.patch b/CVE-2020-0452.patch
new file mode 100644
index 0000000..4a499ff
--- /dev/null
+++ b/CVE-2020-0452.patch
@@ -0,0 +1,32 @@
+From 9266d14b5ca4e29b970fa03272318e5f99386e06 Mon Sep 17 00:00:00 2001
+From: Marcus Meissner <marcus@jet.franken.de>
+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
+---
+ NEWS | 3 ++-
+ libexif/exif-entry.c | 4 ++--
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/libexif/exif-entry.c b/libexif/exif-entry.c
+index 3fc0ff9..4b866ce 100644
+--- a/libexif/exif-entry.c
++++ b/libexif/exif-entry.c
+@@ -1371,8 +1371,8 @@ exif_entry_get_value (ExifEntry *e, char *val, unsigned int maxlen)
+ {
+ unsigned char *utf16;
+
+- /* Sanity check the size to prevent overflow */
+- if (e->size+sizeof(uint16_t)+1 < 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 */