summaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorchristos <christos@pkgsrc.org>2019-09-06 14:51:42 +0000
committerchristos <christos@pkgsrc.org>2019-09-06 14:51:42 +0000
commit56969229cacc16e47b8460f771a762e0f75ffb3b (patch)
treef887e5109141fcb8c31b2bcf759b5e1bcf844863 /editors
parent2c511a8ae42f665b04da16b23f423fdd084af29d (diff)
downloadpkgsrc-56969229cacc16e47b8460f771a762e0f75ffb3b.tar.gz
PR/54528: greywolf: fix fortify issue with stack overwrites.
Diffstat (limited to 'editors')
-rw-r--r--editors/jove/patches/patch-proc.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/editors/jove/patches/patch-proc.c b/editors/jove/patches/patch-proc.c
new file mode 100644
index 00000000000..504aa8cee01
--- /dev/null
+++ b/editors/jove/patches/patch-proc.c
@@ -0,0 +1,29 @@
+# $NetBSD: patch-proc.c,v 1.1 2019/09/06 14:51:42 christos Exp $
+
+Don't smash the stack by using the same variable for input and output.
+
+--- proc.c 2015-10-15 14:12:25.000000000 -0400
++++ proc.c 2019-09-06 10:20:35.710848362 -0400
+@@ -330,18 +330,19 @@
+ char *command;
+ {
+ static char bnm[FILESIZE];
+- register char *cp = bnm,
++ char nm[FILESIZE];
++ char *cp = nm,
+ c;
+
+ do {
+ c = *command++;
+ } while (jiswhite(c));
+- while (cp < &bnm[sizeof(bnm) - 1] && c != '\0' && !jiswhite(c)) {
++ while (cp < &nm[sizeof(nm) - 1] && c != '\0' && !jiswhite(c)) {
+ *cp++ = c;
+ c = *command++;
+ }
+ *cp = '\0';
+- strcpy(bnm, jbasename(bnm));
++ strcpy(bnm, jbasename(nm));
+
+ return bnm;
+ }