]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 6.1 - patch 20191015
authorThomas E. Dickey <dickey@invisible-island.net>
Wed, 16 Oct 2019 00:42:21 +0000 (00:42 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Wed, 16 Oct 2019 00:42:21 +0000 (00:42 +0000)
+ improve buffer-checks in captoinfo.c, for some cases when the
  input string is shorter than expected.
> fix two errata in tic (report/testcases by Hongxu Chen):
+ check for missing character after backslash in write_it
+ check for missing characters after "%>" when converting from termcap
  syntax (cf: 980530).

12 files changed:
NEWS
VERSION
dist.mk
ncurses/tinfo/captoinfo.c
package/debian-mingw/changelog
package/debian-mingw64/changelog
package/debian/changelog
package/mingw-ncurses.nsi
package/mingw-ncurses.spec
package/ncurses.spec
package/ncursest.spec
progs/tic.c

diff --git a/NEWS b/NEWS
index 5ba46e9b300c6e062d1404917e08e23b178b4f76..509ff3feadeb9be7cc2e2d1c43c7cdb6b11beb5d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.3389 2019/10/12 21:17:50 tom Exp $
+-- $Id: NEWS,v 1.3393 2019/10/16 00:04:31 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,14 @@ 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.
 
+20191015
+       + improve buffer-checks in captoinfo.c, for some cases when the
+         input string is shorter than expected.
+       > fix two errata in tic (report/testcases by Hongxu Chen):
+       + check for missing character after backslash in write_it
+       + check for missing characters after "%>" when converting from termcap
+         syntax (cf: 980530).
+
 20191012
        + amend recent changes to ncurses*-config and pc-files to filter out
          Debian linker-flags (report by Sven Joachim, cf: 20150516).
diff --git a/VERSION b/VERSION
index b8433300e855629cf0a4496100d837191f3d47c5..0e4e4761acde22ed5a3f2743d4bcb1a280e107c4 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5:0:10 6.1     20191012
+5:0:10 6.1     20191015
diff --git a/dist.mk b/dist.mk
index 8832349b8882dad3458881e4a8739e5fa207a49f..66ba0ddfa26ade0765ef18e478581315d5dffeff 100644 (file)
--- a/dist.mk
+++ b/dist.mk
@@ -25,7 +25,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: dist.mk,v 1.1309 2019/10/12 15:30:55 tom Exp $
+# $Id: dist.mk,v 1.1310 2019/10/15 21:46:57 tom Exp $
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
@@ -37,7 +37,7 @@ SHELL = /bin/sh
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 6
 NCURSES_MINOR = 1
-NCURSES_PATCH = 20191012
+NCURSES_PATCH = 20191015
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 6a2252ee25406ede681d42f76d2ed7dda5aaba2e..a9eb1e53454d355fe9e77c7a9beafdce5e27f065 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2017,2018 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2018,2019 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -97,7 +97,7 @@
 #include <ctype.h>
 #include <tic.h>
 
-MODULE_ID("$Id: captoinfo.c,v 1.96 2018/05/12 16:46:55 tom Exp $")
+MODULE_ID("$Id: captoinfo.c,v 1.97 2019/10/15 23:13:35 tom Exp $")
 
 #if 0
 #define DEBUG_THIS(p) DEBUG(9, p)
@@ -210,7 +210,7 @@ cvtchar(register const char *sp)
            break;
        default:
            c = UChar(*sp);
-           len = 2;
+           len = (c != '\0') ? 2 : 1;
            break;
        }
        break;
@@ -224,13 +224,13 @@ cvtchar(register const char *sp)
        break;
     default:
        c = UChar(*sp);
-       len = 1;
+       len = (c != '\0') ? 1 : 0;
     }
     if (isgraph(c) && c != ',' && c != '\'' && c != '\\' && c != ':') {
        dp = save_string(dp, "%\'");
        dp = save_char(dp, c);
        dp = save_char(dp, '\'');
-    } else {
+    } else if (c != '\0') {
        dp = save_string(dp, "%{");
        if (c > 99)
            dp = save_char(dp, c / 100 + '0');
@@ -313,7 +313,7 @@ _nc_captoinfo(const char *cap, const char *s, int const parameterized)
     if (s == 0)
        s = "";
     if (parameterized >= 0 && isdigit(UChar(*s)))
-       for (capstart = s;; s++)
+       for (capstart = s; *s != '\0'; s++)
            if (!(isdigit(UChar(*s)) || *s == '*' || *s == '.'))
                break;
 
@@ -360,13 +360,18 @@ _nc_captoinfo(const char *cap, const char *s, int const parameterized)
                dp = save_string(dp, "%{2}%*%-");
                break;
            case '>':
-               getparm(param, 2);
                /* %?%{x}%>%t%{y}%+%; */
-               dp = save_string(dp, "%?");
-               s += cvtchar(s);
-               dp = save_string(dp, "%>%t");
-               s += cvtchar(s);
-               dp = save_string(dp, "%+%;");
+               if (s[0] && s[1]) {
+                   getparm(param, 2);
+                   dp = save_string(dp, "%?");
+                   s += cvtchar(s);
+                   dp = save_string(dp, "%>%t");
+                   s += cvtchar(s);
+                   dp = save_string(dp, "%+%;");
+               } else {
+                   _nc_warning("expected two characters after %%>");
+                   dp = save_string(dp, "%>");
+               }
                break;
            case 'a':
                if ((*s == '=' || *s == '+' || *s == '-'
@@ -492,7 +497,8 @@ _nc_captoinfo(const char *cap, const char *s, int const parameterized)
            }
            break;
        default:
-           dp = save_char(dp, *s++);
+           if (*s != '\0')
+               dp = save_char(dp, *s++);
            break;
        }
     }
@@ -503,7 +509,7 @@ _nc_captoinfo(const char *cap, const char *s, int const parameterized)
      */
     if (capstart) {
        dp = save_string(dp, "$<");
-       for (s = capstart;; s++)
+       for (s = capstart; *s != '\0'; s++)
            if (isdigit(UChar(*s)) || *s == '*' || *s == '.')
                dp = save_char(dp, *s);
            else
index b0454cb49b434843fb0a75bc64a7f17aef9028b6..65032439896b8ab716bee52174fd2ba610522a5d 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.1+20191012) unstable; urgency=low
+ncurses6 (6.1+20191015) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Fri, 11 Oct 2019 19:37:45 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Tue, 15 Oct 2019 17:46:57 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index b0454cb49b434843fb0a75bc64a7f17aef9028b6..65032439896b8ab716bee52174fd2ba610522a5d 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.1+20191012) unstable; urgency=low
+ncurses6 (6.1+20191015) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Fri, 11 Oct 2019 19:37:45 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Tue, 15 Oct 2019 17:46:57 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index e739b5dd508c045a88764327f6ebd6ad2de180bc..08605a4f78ff44f4ca3f18464618c3e21dc3cd8a 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.1+20191012) unstable; urgency=low
+ncurses6 (6.1+20191015) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Fri, 11 Oct 2019 19:37:45 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Tue, 15 Oct 2019 17:46:57 -0400
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index 10a27990879bb81cf3c07ed069e69834f0ce0724..d91112de35fc4d04d129bfaf9928af360721ccbe 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.355 2019/10/12 15:30:55 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.356 2019/10/15 21:46:57 tom Exp $\r
 \r
 ; TODO add examples\r
 ; TODO bump ABI to 6\r
@@ -10,7 +10,7 @@
 !define VERSION_MAJOR "6"\r
 !define VERSION_MINOR "1"\r
 !define VERSION_YYYY  "2019"\r
-!define VERSION_MMDD  "1012"\r
+!define VERSION_MMDD  "1015"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index 41bd788fe02ccf41666643e5c0b97d286c3fa2ac..8f10c47550005f14d4362f243a4f1d42ac7d72fb 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.1
-Release: 20191012
+Release: 20191015
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 478c66561b0037d59dd7becc5ea945c1613bf0cf..84b734cef16b1bf9b7e3a62300ab753417211613 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.1
-Release: 20191012
+Release: 20191015
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 1ada75f53bda37c0dac2d47d051d9fcce0813e44..94556487547ef3154a9d901d81aa284667307080 100644 (file)
@@ -1,7 +1,7 @@
 Summary: Curses library with POSIX thread support.
 Name: ncursest6
 Version: 6.1
-Release: 20191012
+Release: 20191015
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 2f3b5877b1557f464d5bf6328d0a9726fd7000a2..b8a12d259ed0273202fce3c87b5bff1e6303406c 100644 (file)
@@ -48,7 +48,7 @@
 #include <parametrized.h>
 #include <transform.h>
 
-MODULE_ID("$Id: tic.c,v 1.278 2019/07/27 22:44:21 tom Exp $")
+MODULE_ID("$Id: tic.c,v 1.279 2019/10/15 22:18:29 tom Exp $")
 
 #define STDIN_NAME "<stdin>"
 
@@ -218,7 +218,8 @@ write_it(ENTRY * ep)
            while ((ch = *t++) != 0) {
                *d++ = (char) ch;
                if (ch == '\\') {
-                   *d++ = *t++;
+                   if ((*d++ = *t++) == '\0')
+                       break;
                } else if ((ch == '%')
                           && (*t == L_BRACE)) {
                    char *v = 0;