diff options
-rw-r--r-- | user/gnu-ghostscript/APKBUILD | 8 | ||||
-rw-r--r-- | user/gnu-ghostscript/do-not-use-sprintf.patch | 20 |
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); |