Hi,

When experimenting with yash, I found a crash.

Reported it and upstream fixed it quickly. Diff to our port below.

OK?

Index: Makefile
===================================================================
RCS file: /cvs/ports/shells/yash/Makefile,v
retrieving revision 1.14
diff -u -p -r1.14 Makefile
--- Makefile    21 Sep 2023 14:00:28 -0000      1.14
+++ Makefile    13 Nov 2023 20:28:31 -0000
@@ -1,6 +1,7 @@
 COMMENT=       POSIX-compliant command line shell
 
 VERSION=       2.55
+REVISION =     0
 DISTNAME=      yash-${VERSION}
 CATEGORIES=    shells
 HOMEPAGE=      https://magicant.github.io/yash/
Index: patches/patch-lineedit_editing_c
===================================================================
RCS file: patches/patch-lineedit_editing_c
diff -N patches/patch-lineedit_editing_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-lineedit_editing_c    13 Nov 2023 20:28:15 -0000
@@ -0,0 +1,20 @@
+Don't overrun buffer in emacs-capitalize-word.
+
+https://github.com/magicant/yash/commit/6a60fd9747d0170c396322e9466734e7c6567b54
+
+Index: lineedit/editing.c
+--- lineedit/editing.c.orig
++++ lineedit/editing.c
+@@ -3199,8 +3199,10 @@ void cmd_emacs_capitalize_word(wchar_t c __attribute__
+       do {
+           while (*s != L'\0' && !iswalnum(*s))
+               s++;
+-          *s = towupper(*s);
+-          s++;
++          if (*s != L'\0') {
++              *s = towupper(*s);
++              s++;
++          }
+           while (*s != L'\0' && iswalnum(*s))
+               s++;
+       } while (*s != L'\0' && --count > 0);

-- 
Best Regards
Edd Barrett

https://www.theunixzoo.co.uk

Reply via email to