summaryrefslogtreecommitdiff
path: root/system/pdksh/patches/044_Debian-emacs-crash.patch
diff options
context:
space:
mode:
Diffstat (limited to 'system/pdksh/patches/044_Debian-emacs-crash.patch')
-rw-r--r--system/pdksh/patches/044_Debian-emacs-crash.patch18
1 files changed, 18 insertions, 0 deletions
diff --git a/system/pdksh/patches/044_Debian-emacs-crash.patch b/system/pdksh/patches/044_Debian-emacs-crash.patch
new file mode 100644
index 0000000000..047302811b
--- /dev/null
+++ b/system/pdksh/patches/044_Debian-emacs-crash.patch
@@ -0,0 +1,18 @@
+ * emacs.c: Fix segmentation fault bug when ksh used bash history file
+ (closes: #284358).
+Index: pdksh-5.2.14/emacs.c
+===================================================================
+--- pdksh-5.2.14.orig/emacs.c 2008-04-15 20:49:47.000000000 +0200
++++ pdksh-5.2.14/emacs.c 2008-04-15 20:53:50.000000000 +0200
+@@ -883,9 +883,9 @@
+ }
+ x_histp = hp;
+ oldsize = x_size_str(xbuf);
+- (void)strcpy(xbuf, *hp);
++ (void)strncpy(xbuf, *hp, xend - xbuf - 1);
+ xbp = xbuf;
+- xep = xcp = xbuf + strlen(*hp);
++ xep = xcp = xbuf + strlen(xbuf);
+ xlp_valid = FALSE;
+ if (xep > x_lastcp())
+ x_goto(xep);