From: Thomas E. Dickey Date: Wed, 22 Nov 2023 00:23:27 +0000 (+0000) Subject: ncurses 6.4 - patch 20231121 X-Git-Tag: v6.5~23 X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=89d66edde5b9525fff1f4343470231344d1ff2c6 ncurses 6.4 - patch 20231121 + amend fix for Debian #1055882, correcting nul terminator check in waddnstr (Debian #1056340). --- diff --git a/NEWS b/NEWS index c8c40411..55b43488 100644 --- a/NEWS +++ b/NEWS @@ -26,7 +26,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.4033 2023/11/19 00:46:27 tom Exp $ +-- $Id: NEWS,v 1.4035 2023/11/21 21:51:04 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -46,6 +46,10 @@ See the AUTHORS file for the corresponding full names. Changes through 1.9.9e did not credit all contributions; it is not possible to add this information. +20231121 + + amend fix for Debian #1055882, correcting nul terminator check in + waddnstr (Debian #1056340). + 20231118 + improve description of length-parameter and error-returns in several manpages: curs_addchstr.3x, curs_addstr.3x, curs_addwstr.3x, diff --git a/VERSION b/VERSION index 5be4535c..89dd3323 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5:0:10 6.4 20231118 +5:0:10 6.4 20231121 diff --git a/dist.mk b/dist.mk index d9f52767..ee5177d6 100644 --- a/dist.mk +++ b/dist.mk @@ -26,7 +26,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.1577 2023/11/18 10:46:15 tom Exp $ +# $Id: dist.mk,v 1.1578 2023/11/21 21:44:33 tom Exp $ # Makefile for creating ncurses distributions. # # This only needs to be used directly as a makefile by developers, but @@ -38,7 +38,7 @@ SHELL = /bin/sh # These define the major/minor/patch versions of ncurses. NCURSES_MAJOR = 6 NCURSES_MINOR = 4 -NCURSES_PATCH = 20231118 +NCURSES_PATCH = 20231121 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/ncurses/base/lib_addstr.c b/ncurses/base/lib_addstr.c index 43f329ca..a3753af0 100644 --- a/ncurses/base/lib_addstr.c +++ b/ncurses/base/lib_addstr.c @@ -45,7 +45,7 @@ #include -MODULE_ID("$Id: lib_addstr.c,v 1.61 2023/11/18 23:54:19 tom Exp $") +MODULE_ID("$Id: lib_addstr.c,v 1.62 2023/11/21 21:47:23 tom Exp $") NCURSES_EXPORT(int) waddnstr(WINDOW *win, const char *astr, int n) @@ -66,7 +66,7 @@ waddnstr(WINDOW *win, const char *astr, int n) (explicit ? n : (int) strlen(str)))); if (!explicit) n = INT_MAX; - while ((explicit || (*str != '\0')) && (n-- > 0)) { + while ((n-- > 0) && (*str != '\0')) { NCURSES_CH_T ch; TR(TRACE_VIRTPUT, ("*str = %#o", UChar(*str))); SetChar(ch, UChar(*str++), A_NORMAL); @@ -241,7 +241,7 @@ waddnwstr(WINDOW *win, const wchar_t *str, int n) (explicit ? n : (int) wcslen(str)))); if (!explicit) n = INT_MAX; - while ((explicit || (*str != L('\0'))) && (n-- > 0)) { + while ((n-- > 0) && (*str != L('\0'))) { NCURSES_CH_T ch; TR(TRACE_VIRTPUT, ("*str[0] = %#lx", (unsigned long) *str)); SetChar(ch, *str++, A_NORMAL); diff --git a/ncurses/base/lib_insnstr.c b/ncurses/base/lib_insnstr.c index 338a96b3..caec48e8 100644 --- a/ncurses/base/lib_insnstr.c +++ b/ncurses/base/lib_insnstr.c @@ -41,7 +41,7 @@ #include #include -MODULE_ID("$Id: lib_insnstr.c,v 1.9 2023/11/18 23:47:19 tom Exp $") +MODULE_ID("$Id: lib_insnstr.c,v 1.10 2023/11/21 21:58:03 tom Exp $") NCURSES_EXPORT(int) winsnstr(WINDOW *win, const char *s, int n) @@ -62,7 +62,7 @@ winsnstr(WINDOW *win, const char *s, int n) * call to the wins_nwstr() function. */ if (sp->_screen_unicode) { - size_t nn = (n >= 0) ? (size_t) n : strlen(s); + size_t nn = (n > 0) ? (size_t) n : strlen(s); wchar_t *buffer = typeMalloc(wchar_t, nn + 1); if (buffer != 0) { mbstate_t state; diff --git a/ncurses/widechar/lib_ins_wch.c b/ncurses/widechar/lib_ins_wch.c index 1be3b0ee..ecaabcc9 100644 --- a/ncurses/widechar/lib_ins_wch.c +++ b/ncurses/widechar/lib_ins_wch.c @@ -40,7 +40,7 @@ #include -MODULE_ID("$Id: lib_ins_wch.c,v 1.27 2023/11/18 23:48:20 tom Exp $") +MODULE_ID("$Id: lib_ins_wch.c,v 1.29 2023/11/21 21:53:28 tom Exp $") /* * Insert the given character, updating the current location to simplify @@ -111,10 +111,8 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n) if (win != 0 && wstr != 0 && n != 0) { - bool explicit = TRUE; if (n < 0) { - explicit = FALSE; n = INT_MAX; } code = OK; @@ -125,7 +123,7 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n) NCURSES_SIZE_T oy = win->_cury; NCURSES_SIZE_T ox = win->_curx; - for (cp = wstr; (explicit || (*cp != L'\0')) && ((cp - wstr) < n); cp++) { + for (cp = wstr; ((cp - wstr) < n) && (*cp != L'\0'); cp++) { int len = _nc_wacs_width(*cp); if ((len >= 0 && len != 1) || !is7bits(*cp)) { diff --git a/package/debian-mingw/changelog b/package/debian-mingw/changelog index 079d4e9e..156469e4 100644 --- a/package/debian-mingw/changelog +++ b/package/debian-mingw/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.4+20231118) unstable; urgency=low +ncurses6 (6.4+20231121) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Mon, 13 Nov 2023 20:05:39 -0500 + -- Thomas E. Dickey Tue, 21 Nov 2023 16:44:33 -0500 ncurses6 (5.9+20131005) unstable; urgency=low diff --git a/package/debian-mingw64/changelog b/package/debian-mingw64/changelog index 079d4e9e..156469e4 100644 --- a/package/debian-mingw64/changelog +++ b/package/debian-mingw64/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.4+20231118) unstable; urgency=low +ncurses6 (6.4+20231121) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Mon, 13 Nov 2023 20:05:39 -0500 + -- Thomas E. Dickey Tue, 21 Nov 2023 16:44:33 -0500 ncurses6 (5.9+20131005) unstable; urgency=low diff --git a/package/debian/changelog b/package/debian/changelog index edc71475..4c6170b3 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.4+20231118) unstable; urgency=low +ncurses6 (6.4+20231121) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Mon, 13 Nov 2023 20:05:39 -0500 + -- Thomas E. Dickey Tue, 21 Nov 2023 16:44:33 -0500 ncurses6 (5.9+20120608) unstable; urgency=low diff --git a/package/mingw-ncurses.nsi b/package/mingw-ncurses.nsi index 9a69bf93..0ea10d01 100644 --- a/package/mingw-ncurses.nsi +++ b/package/mingw-ncurses.nsi @@ -1,4 +1,4 @@ -; $Id: mingw-ncurses.nsi,v 1.617 2023/11/14 01:05:39 tom Exp $ +; $Id: mingw-ncurses.nsi,v 1.618 2023/11/21 21:44:33 tom Exp $ ; TODO add examples ; TODO bump ABI to 6 @@ -10,7 +10,7 @@ !define VERSION_MAJOR "6" !define VERSION_MINOR "4" !define VERSION_YYYY "2023" -!define VERSION_MMDD "1118" +!define VERSION_MMDD "1121" !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD} !define MY_ABI "5" diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec index 6865b071..1b4b8431 100644 --- a/package/mingw-ncurses.spec +++ b/package/mingw-ncurses.spec @@ -3,7 +3,7 @@ Summary: shared libraries for terminal handling Name: mingw32-ncurses6 Version: 6.4 -Release: 20231118 +Release: 20231121 License: X11 Group: Development/Libraries URL: https://invisible-island.net/ncurses/ diff --git a/package/ncurses.spec b/package/ncurses.spec index 6c79b367..efc5072c 100644 --- a/package/ncurses.spec +++ b/package/ncurses.spec @@ -1,7 +1,7 @@ Summary: shared libraries for terminal handling Name: ncurses6 Version: 6.4 -Release: 20231118 +Release: 20231121 License: X11 Group: Development/Libraries URL: https://invisible-island.net/ncurses/ diff --git a/package/ncursest.spec b/package/ncursest.spec index e6d27a12..8a16ae65 100644 --- a/package/ncursest.spec +++ b/package/ncursest.spec @@ -1,7 +1,7 @@ Summary: Curses library with POSIX thread support. Name: ncursest6 Version: 6.4 -Release: 20231118 +Release: 20231121 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz