Skip to contentSkip to conversation

giflib: upgrade 5.1.4 -> 5.2.1

PATCH In review Andreas Müller 2 participants 3 messages May 22, 2021

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 giflib: upgrade 5.1.4 -> 5.2.1

* Project removed autotools configuration files. So it is now a pure Makefile build which requires autotools-brokensep
* Checked sources: Back ported CVE-patch can go

---
V2:
* explain autotool -> -brokensep in commit message
* add comment in do_install explaining why we tailored it

 .../giflib/files/CVE-2019-15133.patch         | 23 -------------------
 .../{giflib_5.1.4.bb => giflib_5.2.1.bb}      | 20 ++++++++--------
 2 files changed, 11 insertions(+), 32 deletions(-)
 delete mode 100644 meta-oe/recipes-devtools/giflib/files/CVE-2019-15133.patch
 rename meta-oe/recipes-devtools/giflib/{giflib_5.1.4.bb => giflib_5.2.1.bb} (50%)
meta-oe/recipes-devtools/giflib/files/CVE-2019-15133.patch deleted +0 -23
deleted file mode 100644
index 9957be82f..000000000
@@ -1,23 +0,0 @@
-From 799eb6a3af8a3dd81e2429bf11a72a57e541f908 Mon Sep 17 00:00:00 2001
-From: "Eric S. Raymond" <[email protected]>
-Date: Sun, 17 Mar 2019 12:37:21 -0400
-Subject: [PATCH] Address SF bug #119: MemorySanitizer: FPE on unknown address
-
----
- dgif_lib.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-Upstream-status: Backport [https://sourceforge.net/p/giflib/code/ci/799eb6a3af8a3dd81e2429bf11a72a57e541f908/]
-CVE: CVE-2019-15133
-
---- a/lib/dgif_lib.c	2021-01-13 19:28:18.923493586 +0100
-+++ b/lib/dgif_lib.c	2021-01-13 19:28:55.245863085 +0100
-@@ -1099,7 +1099,7 @@ DGifSlurp(GifFileType *GifFile)
- 
-               sp = &GifFile->SavedImages[GifFile->ImageCount - 1];
-               /* Allocate memory for the image */
--              if (sp->ImageDesc.Width < 0 && sp->ImageDesc.Height < 0 &&
-+              if (sp->ImageDesc.Width <= 0 && sp->ImageDesc.Height <= 0 &&
-                       sp->ImageDesc.Width > (INT_MAX / sp->ImageDesc.Height)) {
-                   return GIF_ERROR;
-               }
meta-oe/recipes-devtools/giflib/giflib_5.2.1.bb renamed from meta-oe/recipes-devtools/giflib/giflib_5.1.4.bb +11 -9
similarity index 50%
rename from meta-oe/recipes-devtools/giflib/giflib_5.1.4.bb
rename to meta-oe/recipes-devtools/giflib/giflib_5.2.1.bb
index 1871bab46..d8757ef58 100644
@@ -3,14 +3,19 @@ SECTION = "libs"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://COPYING;md5=ae11c61b04b2917be39b11f78d71519a"
 
-SRC_URI = " \
-    ${SOURCEFORGE_MIRROR}/giflib/${BP}.tar.bz2 \
-    file://CVE-2019-15133.patch \
-"
-
 CVE_PRODUCT = "giflib_project:giflib"
 
-inherit autotools
+DEPENDS = "xmlto-native"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/giflib/${BP}.tar.gz"
+SRC_URI[sha256sum] = "31da5562f44c5f15d63340a09a4fd62b48c45620cd302f77a6d9acf0077879bd"
+
+inherit autotools-brokensep
+
+do_install() {
+    # using autotools's default will end up in /usr/local
+    oe_runmake DESTDIR=${D} PREFIX=${prefix} LIBDIR=${libdir} install
+}
 
 PACKAGES += "${PN}-utils"
 FILES_${PN} = "${libdir}/libgif.so.*"
@@ -19,6 +24,3 @@ FILES_${PN}-utils = "${bindir}"
 BBCLASSEXTEND = "native"
 
 RDEPENDS_${PN}-utils = "perl"
-
-SRC_URI[md5sum] = "2c171ced93c0e83bb09e6ccad8e3ba2b"
-SRC_URI[sha256sum] = "df27ec3ff24671f80b29e6ab1c4971059c14ac3db95406884fc26574631ba8d5"
Signature · 1 line
2.31.1
#1 lore raw
Quoted 3 lines · Andreas Müller

* Project removed autotools configuration files. So it is now a pure Makefile build which requires autotools-brokensep

if autotools support is removed then I wonder if using any of autotools classes is the right thing to do

Quoted 88 lines

* Checked sources: Back ported CVE-patch can go

---
V2:
* explain autotool -> -brokensep in commit message
* add comment in do_install explaining why we tailored it

 .../giflib/files/CVE-2019-15133.patch         | 23 -------------------
 .../{giflib_5.1.4.bb => giflib_5.2.1.bb}      | 20 ++++++++--------
 2 files changed, 11 insertions(+), 32 deletions(-)
 delete mode 100644 meta-oe/recipes-devtools/giflib/files/CVE-2019-15133.patch
 rename meta-oe/recipes-devtools/giflib/{giflib_5.1.4.bb => giflib_5.2.1.bb} (50%)
meta-oe/recipes-devtools/giflib/files/CVE-2019-15133.patch deleted +0 -23
deleted file mode 100644
index 9957be82f..000000000
@@ -1,23 +0,0 @@
-From 799eb6a3af8a3dd81e2429bf11a72a57e541f908 Mon Sep 17 00:00:00 2001
-From: "Eric S. Raymond" <[email protected]>
-Date: Sun, 17 Mar 2019 12:37:21 -0400
-Subject: [PATCH] Address SF bug #119: MemorySanitizer: FPE on unknown address
-
----
- dgif_lib.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-Upstream-status: Backport [https://sourceforge.net/p/giflib/code/ci/799eb6a3af8a3dd81e2429bf11a72a57e541f908/]
-CVE: CVE-2019-15133
-
---- a/lib/dgif_lib.c   2021-01-13 19:28:18.923493586 +0100
-+++ b/lib/dgif_lib.c   2021-01-13 19:28:55.245863085 +0100
-@@ -1099,7 +1099,7 @@ DGifSlurp(GifFileType *GifFile)
-
-               sp = &GifFile->SavedImages[GifFile->ImageCount - 1];
-               /* Allocate memory for the image */
--              if (sp->ImageDesc.Width < 0 && sp->ImageDesc.Height < 0 &&
-+              if (sp->ImageDesc.Width <= 0 && sp->ImageDesc.Height <= 0 &&
-                       sp->ImageDesc.Width > (INT_MAX / sp->ImageDesc.Height)) {
-                   return GIF_ERROR;
-               }
meta-oe/recipes-devtools/giflib/giflib_5.2.1.bb renamed from meta-oe/recipes-devtools/giflib/giflib_5.1.4.bb +11 -10
similarity index 50%
rename from meta-oe/recipes-devtools/giflib/giflib_5.1.4.bb
rename to meta-oe/recipes-devtools/giflib/giflib_5.2.1.bb
index 1871bab46..d8757ef58 100644
@@ -3,14 +3,19 @@ SECTION = "libs"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://COPYING;md5=ae11c61b04b2917be39b11f78d71519a"
 
-SRC_URI = " \
-    ${SOURCEFORGE_MIRROR}/giflib/${BP}.tar.bz2 \
-    file://CVE-2019-15133.patch \
-"
-
 CVE_PRODUCT = "giflib_project:giflib"
 
-inherit autotools
+DEPENDS = "xmlto-native"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/giflib/${BP}.tar.gz"
+SRC_URI[sha256sum] = "31da5562f44c5f15d63340a09a4fd62b48c45620cd302f77a6d9acf0077879bd"
+
+inherit autotools-brokensep
+
+do_install() {
+    # using autotools's default will end up in /usr/local
+    oe_runmake DESTDIR=${D} PREFIX=${prefix} LIBDIR=${libdir} install
+}
 
 PACKAGES += "${PN}-utils"
 FILES_${PN} = "${libdir}/libgif.so.*"
@@ -19,6 +24,3 @@ FILES_${PN}-utils = "${bindir}"
 BBCLASSEXTEND = "native"
 
 RDEPENDS_${PN}-utils = "perl"
-
-SRC_URI[md5sum] = "2c171ced93c0e83bb09e6ccad8e3ba2b"
-SRC_URI[sha256sum] = "df27ec3ff24671f80b29e6ab1c4971059c14ac3db95406884fc26574631ba8d5"
--

2.31.1

#2 lore raw
Quoted 8 lines · Khem Raj
Quoted 3 lines · Andreas Müller

* Project removed autotools configuration files. So it is now a pure Makefile build which requires autotools-brokensep

if autotools support is removed then I wonder if using any of autotools classes is the right thing to do

Correct - the only helpful task could be do_install but that is overriden here anyway. V3 comes in a few hours...

Cheers

Andreas