summaryrefslogtreecommitdiff
path: root/user/gnu-ghostscript
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-01-14 19:12:36 +0000
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-01-14 19:12:36 +0000
commite587383289c6c1b7931e5acffa22b72daa946dce (patch)
treeaac8e5ce73eea6013172fc3b9fc4ec4667877168 /user/gnu-ghostscript
parent24d6d9273c29fc00b392ac2fa74ff51b8d06f073 (diff)
downloadpackages-e587383289c6c1b7931e5acffa22b72daa946dce.tar.gz
packages-e587383289c6c1b7931e5acffa22b72daa946dce.tar.bz2
packages-e587383289c6c1b7931e5acffa22b72daa946dce.tar.xz
packages-e587383289c6c1b7931e5acffa22b72daa946dce.zip
user/gnu-ghostscript: fix sprintf usage
Diffstat (limited to 'user/gnu-ghostscript')
-rw-r--r--user/gnu-ghostscript/APKBUILD8
-rw-r--r--user/gnu-ghostscript/do-not-use-sprintf.patch20
2 files changed, 25 insertions, 3 deletions
diff --git a/user/gnu-ghostscript/APKBUILD b/user/gnu-ghostscript/APKBUILD
index 633582fb6..b0ecc1b57 100644
--- a/user/gnu-ghostscript/APKBUILD
+++ b/user/gnu-ghostscript/APKBUILD
@@ -12,9 +12,9 @@ makedepends="dbus-dev fontconfig-dev freetype-dev lcms2-dev libice-dev
libjpeg-turbo-dev libpaper-dev libpng-dev libx11-dev libxext-dev
libxt-dev tiff-dev zlib-dev"
subpackages="$pkgname-doc"
-source="ftp://ftp.gnu.org/gnu/ghostscript/gnu-ghostscript-$pkgver.tar.xz"
-sha512sums="658f6ae14b29965c7959b9bd1463760d7fb03b35251446fc37101dbe7ee2866c74a0803e22b2f4488be3221d026578be1d6be7b562ff240036134fbf83edabf9 gnu-ghostscript-9.14.1.tar.xz"
-builddir="$srcdir/gnu-ghostscript-$pkgver"
+source="ftp://ftp.gnu.org/gnu/ghostscript/gnu-ghostscript-$pkgver.tar.xz
+ do-not-use-sprintf.patch
+ "
build() {
cd "$builddir"
@@ -38,3 +38,5 @@ package() {
make DESTDIR="$pkgdir" install
}
+sha512sums="658f6ae14b29965c7959b9bd1463760d7fb03b35251446fc37101dbe7ee2866c74a0803e22b2f4488be3221d026578be1d6be7b562ff240036134fbf83edabf9 gnu-ghostscript-9.14.1.tar.xz
+2c1d3a487ff7ee65855d3c587747bd8bf0f5a61ef30f4c84e6df237d6680a88ba72f328c7294eee0058eb69f770f3e539f29cb2ea4c55bcac98f22c5bd203020 do-not-use-sprintf.patch"
diff --git a/user/gnu-ghostscript/do-not-use-sprintf.patch b/user/gnu-ghostscript/do-not-use-sprintf.patch
new file mode 100644
index 000000000..7bf03cd89
--- /dev/null
+++ b/user/gnu-ghostscript/do-not-use-sprintf.patch
@@ -0,0 +1,20 @@
+--- gnu-ghostscript-9.14.1/base/mkromfs.c.old 2014-07-02 14:46:25.000000000 +0000
++++ gnu-ghostscript-9.14.1/base/mkromfs.c 2019-01-14 19:08:34.441981516 +0000
+@@ -1937,7 +1937,7 @@
+ for (i = 0; i < len; ++i) {
+ int c = str[i];
+
+- sprintf(linebuf,
++ snprintf(linebuf, sizeof(linebuf),
+ (c < 32 || c >= 127 ? "%d," :
+ c == '\'' || c == '\\' ? "'\\%c'," : "'%c',"),
+ c);
+@@ -2228,7 +2228,7 @@
+ char line[LINE_SIZE + 1];
+
+ while ((rl(in, line, LINE_SIZE), line[0])) {
+- sprintf(linebuf, "%s", line );
++ snprintf(linebuf, sizeof(linebuf), "%s", line );
+ wl(linebuf);
+ }
+ mergefile(os_prefix, inname, in, config, false);