summaryrefslogtreecommitdiff
path: root/user/gnu-ghostscript/do-not-use-sprintf.patch
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/do-not-use-sprintf.patch
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/do-not-use-sprintf.patch')
-rw-r--r--user/gnu-ghostscript/do-not-use-sprintf.patch20
1 files changed, 20 insertions, 0 deletions
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);