pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/graphics/libotf Fix runtime crash of otfview command o...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/868f13812602
branches:  trunk
changeset: 334485:868f13812602
user:      ryoon <ryoon%pkgsrc.org@localhost>
date:      Wed May 29 12:29:00 2019 +0000

description:
Fix runtime crash of otfview command on NetBSD. Bump PKGREVISION

diffstat:

 graphics/libotf/Makefile                        |   3 +-
 graphics/libotf/distinfo                        |   3 +-
 graphics/libotf/patches/patch-example_otfview.c |  37 +++++++++++++++++++++++++
 3 files changed, 41 insertions(+), 2 deletions(-)

diffs (66 lines):

diff -r 863849d3472e -r 868f13812602 graphics/libotf/Makefile
--- a/graphics/libotf/Makefile  Wed May 29 11:02:22 2019 +0000
+++ b/graphics/libotf/Makefile  Wed May 29 12:29:00 2019 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.17 2018/05/07 07:55:33 dholland Exp $
+# $NetBSD: Makefile,v 1.18 2019/05/29 12:29:00 ryoon Exp $
 
 DISTNAME=      libotf-0.9.16
+PKGREVISION=   1
 CATEGORIES=    graphics
 MASTER_SITES=  http://download.savannah.gnu.org/releases/m17n/
 
diff -r 863849d3472e -r 868f13812602 graphics/libotf/distinfo
--- a/graphics/libotf/distinfo  Wed May 29 11:02:22 2019 +0000
+++ b/graphics/libotf/distinfo  Wed May 29 12:29:00 2019 +0000
@@ -1,7 +1,8 @@
-$NetBSD: distinfo,v 1.10 2018/05/07 07:55:33 dholland Exp $
+$NetBSD: distinfo,v 1.11 2019/05/29 12:29:00 ryoon Exp $
 
 SHA1 (libotf-0.9.16.tar.gz) = ee3037f468a5381de89846ee1c78320964cfbf78
 RMD160 (libotf-0.9.16.tar.gz) = ddea1124409fa97a58386251aa70b961c11b9374
 SHA512 (libotf-0.9.16.tar.gz) = 0f68c45c1224f02dc0f1a8e9915dd9c1c70d71259b4e2f7bbd4fbec6426e58d4a26e4cbf28dbb8ed051ba6f532f99fc4e74b4ddf97a93ec947fa6260c875d0b4
 Size (libotf-0.9.16.tar.gz) = 423979 bytes
 SHA1 (patch-configure) = 5d43a445f6950ac14e5a91f37b25601d951868c2
+SHA1 (patch-example_otfview.c) = 1fec42a22bef9ecfefc9656b4f69ec6c95715bb6
diff -r 863849d3472e -r 868f13812602 graphics/libotf/patches/patch-example_otfview.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/libotf/patches/patch-example_otfview.c   Wed May 29 12:29:00 2019 +0000
@@ -0,0 +1,37 @@
+$NetBSD: patch-example_otfview.c,v 1.1 2019/05/29 12:29:00 ryoon Exp $
+
+* Fix a runtime crash on NetBSD.
+
+--- example/otfview.c.orig     2015-09-02 13:39:25.000000000 +0000
++++ example/otfview.c
+@@ -28,6 +28,7 @@ write to the Free Software Foundation, I
+ #include <sys/stat.h>
+ #include <unistd.h>
+ #include <libgen.h>
++#include <sys/param.h>
+ 
+ #include "config.h"
+ #ifdef HAVE_ALLOCA_H
+@@ -1603,7 +1604,10 @@ ExposeProc (Widget w, XEvent *event, Str
+ {
+   XTextProperty text_prop;
+   char *pname = "otfview";
+-  char *fname = basename (filename);
++  char *tmpfname = basename (filename);
++  size_t len = strlen(tmpfname);
++  char fname[MAXPATHLEN];
++  snprintf(fname, len + 1, "%s", tmpfname);
+   char *name = alloca (strlen (fname) + 3 + strlen (pname) + 1);
+ 
+   sprintf (name, "%s - %s", pname, fname);
+@@ -1735,7 +1739,9 @@ main (int argc, char **argv)
+     char title[256];
+     Arg arg[1];
+ 
+-    filename = basename (filename);
++    char *tmpfilename = basename (filename);
++    size_t len = strlen(tmpfilename);
++    snprintf(filename, len + 1, "%s", tmpfilename);
+     sprintf (title, "%s family:%s style:%s",
+            filename, face->family_name, face->style_name);
+     XtSetArg (arg[0], XtNtitle, title);



Home | Main Index | Thread Index | Old Index