pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/graphics/gd graphics/gd: fix undefined behavior in cty...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/5585e70c2af4
branches:  trunk
changeset: 375927:5585e70c2af4
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sun Feb 25 14:34:22 2018 +0000

description:
graphics/gd: fix undefined behavior in ctype functions

diffstat:

 graphics/gd/Makefile                    |   5 +++--
 graphics/gd/distinfo                    |   3 ++-
 graphics/gd/patches/patch-src_gd__xbm.c |  18 ++++++++++++++++++
 3 files changed, 23 insertions(+), 3 deletions(-)

diffs (54 lines):

diff -r c33e9101f106 -r 5585e70c2af4 graphics/gd/Makefile
--- a/graphics/gd/Makefile      Sun Feb 25 14:19:48 2018 +0000
+++ b/graphics/gd/Makefile      Sun Feb 25 14:34:22 2018 +0000
@@ -1,13 +1,14 @@
-# $NetBSD: Makefile,v 1.116 2017/09/04 06:20:45 adam Exp $
+# $NetBSD: Makefile,v 1.117 2018/02/25 14:34:22 rillig Exp $
 
 DISTNAME=      libgd-2.2.5
 PKGNAME=       ${DISTNAME:S/libgd/gd/}
+PKGREVISION=   1
 CATEGORIES=    graphics
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=libgd/}
 EXTRACT_SUFX=  .tar.xz
 
 MAINTAINER=    adam%NetBSD.org@localhost
-HOMEPAGE=      http://libgd.bitbucket.org/
+HOMEPAGE=      https://libgd.github.io/
 COMMENT=       Graphics library for the dynamic creation of images
 
 GITHUB_PROJECT=        libgd
diff -r c33e9101f106 -r 5585e70c2af4 graphics/gd/distinfo
--- a/graphics/gd/distinfo      Sun Feb 25 14:19:48 2018 +0000
+++ b/graphics/gd/distinfo      Sun Feb 25 14:34:22 2018 +0000
@@ -1,6 +1,7 @@
-$NetBSD: distinfo,v 1.45 2017/09/04 06:20:45 adam Exp $
+$NetBSD: distinfo,v 1.46 2018/02/25 14:34:22 rillig Exp $
 
 SHA1 (libgd-2.2.5.tar.xz) = b777b005c401b6fa310ccf09eeb29f6c6e17ab2c
 RMD160 (libgd-2.2.5.tar.xz) = 1c20f719161da596dac6c5c5b92bde71ddc9aedb
 SHA512 (libgd-2.2.5.tar.xz) = e4598e17a277a75e02255402182cab139cb3f2cffcd68ec05cc10bbeaf6bc7aa39162c3445cd4a7efc1a26b72b9152bbedb187351e3ed099ea51767319997a6b
 Size (libgd-2.2.5.tar.xz) = 2594092 bytes
+SHA1 (patch-src_gd__xbm.c) = 948942243b97a8e96838447ea1325a28ac8c828a
diff -r c33e9101f106 -r 5585e70c2af4 graphics/gd/patches/patch-src_gd__xbm.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/gd/patches/patch-src_gd__xbm.c   Sun Feb 25 14:34:22 2018 +0000
@@ -0,0 +1,18 @@
+$NetBSD: patch-src_gd__xbm.c,v 1.1 2018/02/25 14:34:22 rillig Exp $
+
+Fix undefined behavior while using <ctype.h> functions.
+
+See https://github.com/libgd/libgd/pull/433
+
+--- src/gd_xbm.c.orig  2017-08-30 11:05:54.000000000 +0000
++++ src/gd_xbm.c
+@@ -239,7 +239,8 @@ BGD_DECLARE(void) gdImageXbmCtx(gdImageP
+       } else {
+               for (i=0; i<l; i++) {
+                       /* only in C-locale isalnum() would work */
+-                      if (!isupper(name[i]) && !islower(name[i]) && !isdigit(name[i])) {
++                      unsigned char ch = name[i];
++                      if (!isupper(ch) && !islower(ch) && !isdigit(ch)) {
+                               name[i] = '_';
+                       }
+               }



Home | Main Index | Thread Index | Old Index