]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 6.0 - patch 20150704
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 5 Jul 2015 01:59:07 +0000 (01:59 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 5 Jul 2015 01:59:07 +0000 (01:59 +0000)
+ fix a few problems reported by Coverity.
+ fix comparison against "/usr/include" in misc/gen-pkgconfig.in
  (report by Daiki Ueno, Debian #790548, cf:  20141213).

19 files changed:
NEWS
VERSION
dist.mk
misc/gen-pkgconfig.in
ncurses/base/lib_mouse.c
ncurses/base/lib_screen.c
ncurses/tty/lib_twait.c
package/debian-mingw/changelog
package/debian-mingw64/changelog
package/debian/changelog
package/mingw-ncurses.nsi
package/mingw-ncurses.spec
package/ncurses.spec
progs/MKtermsort.sh
progs/dump_entry.c
progs/tabs.c
progs/tic.c
test/gdc.c
test/testcurs.c

diff --git a/NEWS b/NEWS
index 8f50430aa86a745c93b722a69542f10c30b05636..25963a851e19ac791eac87e1809fec2d7dcc2293 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.2448 2015/06/27 23:12:23 tom Exp $
+-- $Id: NEWS,v 1.2451 2015/07/04 21:01:57 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,11 @@ 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.
 
+20150704
+       + fix a few problems reported by Coverity.
+       + fix comparison against "/usr/include" in misc/gen-pkgconfig.in
+         (report by Daiki Ueno, Debian #790548, cf:  20141213).
+
 20150627
        + modify configure script to remove deprecated ABI 5 symbols when
          building ABI 6.
diff --git a/VERSION b/VERSION
index dc1c3ea961ada54ce59aa1e01a96a016ed199af4..1052e27e79a279024e3a207724ca235fa6288f33 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5:0:9  6.0     20150627
+5:0:9  6.0     20150704
diff --git a/dist.mk b/dist.mk
index e6ed1c68a76bf2efd85eba49dc8c8c86d159ffd2..4ebae2ed910c3224648d2eee73768599c6c8eca3 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.1057 2015/06/26 08:39:24 tom Exp $
+# $Id: dist.mk,v 1.1058 2015/07/03 23:28:48 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 = 0
-NCURSES_PATCH = 20150627
+NCURSES_PATCH = 20150704
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 4e60ff2c4b6c23c6c428f9c825e10bb3efc11c0f..62d09ff61905b8ccfee6443dcd37efdb354065f0 100644 (file)
@@ -1,5 +1,5 @@
 #!@SHELL@
-# $Id: gen-pkgconfig.in,v 1.28 2015/05/16 20:04:42 tom Exp $
+# $Id: gen-pkgconfig.in,v 1.29 2015/07/04 20:37:01 tom Exp $
 ##############################################################################
 # Copyright (c) 2009-2014,2015 Free Software Foundation, Inc.                #
 #                                                                            #
@@ -66,9 +66,9 @@ FORM_LIBRARY="${FORM_NAME}@USE_ARG_SUFFIX@"
 
 CFLAGS="@PKG_CFLAGS@"
 if test "$includedir" != "/usr/include" ; then
-       includetop=`echo "$includedir" | sed -e 's,/include/[^/]*$,/include/,'`
+       includetop=`echo "$includedir" | sed -e 's,/include/[^/]*$,/include,'`
        test "$includetop" = "/usr/include" && includetop="$includedir"
-       if test "x$includetop" != "$includedir"
+       if test "x$includetop" != "x$includedir"
        then
                CFLAGS="$CFLAGS -I${includetop}"
        fi
index 60bf488c8c6464c619e10ac4244e6a89c1474e20..36b6e1eeace40f4a8a9fabd4ede1da6670937800 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2014,2015 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            *
@@ -84,7 +84,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_mouse.c,v 1.165 2014/11/01 12:27:59 tom Exp $")
+MODULE_ID("$Id: lib_mouse.c,v 1.166 2015/07/05 00:28:27 tom Exp $")
 
 #include <tic.h>
 
@@ -1248,7 +1248,6 @@ decode_xterm_SGR1006(SCREEN *sp, MEVENT * eventp)
        int b = data.params[0];
        int b3 = 1 + (b & 3);
 
-       result = TRUE;
        eventp->id = NORMAL_EVENT;
        if (data.final == 'M') {
            (void) handle_wheel(sp, eventp, b, (b & 64) == 64);
index c11df4bb6966a7abaa6841ea7e97fc0e1820de0e..a03ceecef691b50836fb4cd0c7fa6924e32f7589 100644 (file)
@@ -41,7 +41,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_screen.c,v 1.75 2015/04/18 21:58:03 tom Exp $")
+MODULE_ID("$Id: lib_screen.c,v 1.77 2015/07/04 22:54:14 tom Exp $")
 
 #define MAX_SIZE 0x3fff                /* 16k is big enough for a window or pad */
 
@@ -179,6 +179,7 @@ read_txt(FILE *fp)
                    result = 0;
                    break;
                }
+               result = buffer;
            }
            ch = fgetc(fp);
            if (ch == EOF)
@@ -351,7 +352,7 @@ decode_cchar(char *source, cchar_t *fillin, cchar_t *target)
     while (source[0] == MARKER && source[1] == APPEND) {
        source += 2;
        source = decode_char(source, &value);
-       if (append++ < CCHARW_MAX) {
+       if (++append < CCHARW_MAX) {
            chars[append] = (wchar_t) value;
        }
     }
index e912a6389abc5d3957229d3c561a53a29b5630ae..15d07c3e4e81c80edce11a35db01020927af9bed 100644 (file)
@@ -75,7 +75,7 @@
 #endif
 #undef CUR
 
-MODULE_ID("$Id: lib_twait.c,v 1.69 2015/05/02 22:23:16 tom Exp $")
+MODULE_ID("$Id: lib_twait.c,v 1.70 2015/07/04 21:01:02 tom Exp $")
 
 static long
 _nc_gettime(TimeType * t0, int first)
@@ -230,7 +230,8 @@ _nc_timed_wait(SCREEN *sp MAYBE_UNUSED,
 
 #ifdef NCURSES_WGETCH_EVENTS
     if ((mode & TW_EVENT) && evl) {
-       fds = typeMalloc(struct pollfd, MIN_FDS + evl->count);
+       if (fds == fd_list)
+           fds = typeMalloc(struct pollfd, MIN_FDS + evl->count);
        if (fds == 0)
            return TW_NONE;
     }
index 0ba6056f8bd530425bd47b3fee110621dfbaa872..7a38e3ee0009880b90910bded1713f576976a385 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20150627) unstable; urgency=low
+ncurses6 (6.0+20150704) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Fri, 26 Jun 2015 04:39:24 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Fri, 03 Jul 2015 19:28:49 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index 0ba6056f8bd530425bd47b3fee110621dfbaa872..7a38e3ee0009880b90910bded1713f576976a385 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20150627) unstable; urgency=low
+ncurses6 (6.0+20150704) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Fri, 26 Jun 2015 04:39:24 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Fri, 03 Jul 2015 19:28:49 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index a9db3e2d8a85148775849c2729daf70099f8af9d..c1a26a319ea1b6ad3e740e508a9692b1e3beaa69 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20150627) unstable; urgency=low
+ncurses6 (6.0+20150704) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Fri, 26 Jun 2015 04:39:24 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Fri, 03 Jul 2015 19:28:48 -0400
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index a447517833a99a9599a54ff58b143c978fed3f02..8986cb2b382d1f43032c853987649b586b3759c8 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.110 2015/06/26 08:39:24 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.111 2015/07/03 23:28:48 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 "0"\r
 !define VERSION_YYYY  "2015"\r
-!define VERSION_MMDD  "0627"\r
+!define VERSION_MMDD  "0704"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index 60a5a1aa3ee9a99482f02d749e99383ba3417c9a..ac0bc931d1da6d6946eed937c53b4c63f76c3c69 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.0
-Release: 20150627
+Release: 20150704
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 323aaeb4972471893644e7d1d8295907a8dbcc84..84d45badfe7e3425491d6d8d940d14932f154800 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.0
-Release: 20150627
+Release: 20150704
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 2247f14ef2e872adfb277016ba6ccaa8aa056001..9f5db27b3c67e601e4a99bcb60a5cffb70c82900 100755 (executable)
@@ -1,10 +1,10 @@
 #!/bin/sh
-# $Id: MKtermsort.sh,v 1.10 2008/07/12 20:22:54 tom Exp $
+# $Id: MKtermsort.sh,v 1.11 2015/07/04 23:59:54 tom Exp $
 #
 # MKtermsort.sh -- generate indirection vectors for the various sort methods
 #
 ##############################################################################
-# Copyright (c) 1998-2003,2008 Free Software Foundation, Inc.                #
+# Copyright (c) 1998-2008,2015 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 "Software"), #
@@ -139,24 +139,30 @@ echo "";
 
 echo "static const bool bool_from_termcap[] = {";
 $AWK <$DATA '
-$3 == "bool" && substr($7, 1, 1) == "-"       {print "\tFALSE,\t/* ", $2, " */";}
-$3 == "bool" && substr($7, 1, 1) == "Y"       {print "\tTRUE,\t/* ", $2, " */";}
+BEGIN { count = 0; valid = 0; }
+$3 == "bool" && substr($7, 1, 1) == "-"       {print "\tFALSE,\t/* ", $2, " */"; count++; }
+$3 == "bool" && substr($7, 1, 1) == "Y"       {print "\tTRUE,\t/* ", $2, " */"; valid = count++; }
+END { printf "#define OK_bool_from_termcap %d\n", valid; }
 '
 echo "};";
 echo "";
 
 echo "static const bool num_from_termcap[] = {";
 $AWK <$DATA '
-$3 == "num" && substr($7, 1, 1) == "-"        {print "\tFALSE,\t/* ", $2, " */";}
-$3 == "num" && substr($7, 1, 1) == "Y"        {print "\tTRUE,\t/* ", $2, " */";}
+BEGIN { count = 0; valid = 0; }
+$3 == "num" && substr($7, 1, 1) == "-"        {print "\tFALSE,\t/* ", $2, " */"; count++; }
+$3 == "num" && substr($7, 1, 1) == "Y"        {print "\tTRUE,\t/* ", $2, " */"; valid = count++; }
+END { printf "#define OK_num_from_termcap %d\n", valid; }
 '
 echo "};";
 echo "";
 
 echo "static const bool str_from_termcap[] = {";
 $AWK <$DATA '
-$3 == "str" && substr($7, 1, 1) == "-"        {print "\tFALSE,\t/* ", $2, " */";}
-$3 == "str" && substr($7, 1, 1) == "Y"        {print "\tTRUE,\t/* ", $2, " */";}
+BEGIN { count = 0; valid = 0; }
+$3 == "str" && substr($7, 1, 1) == "-"        {print "\tFALSE,\t/* ", $2, " */"; count++; }
+$3 == "str" && substr($7, 1, 1) == "Y"        {print "\tTRUE,\t/* ", $2, " */"; valid = count++; }
+END { printf "#define OK_str_from_termcap %d\n", valid; }
 '
 echo "};";
 echo "";
index 55fe907a3d180f9c61151bfd01e66c2de38dc575..f8b4c22e9f816b47ac3a414751b043327805d3bb 100644 (file)
@@ -39,7 +39,7 @@
 #include "termsort.c"          /* this C file is generated */
 #include <parametrized.h>      /* so is this */
 
-MODULE_ID("$Id: dump_entry.c,v 1.115 2015/05/27 00:57:40 tom Exp $")
+MODULE_ID("$Id: dump_entry.c,v 1.117 2015/07/05 00:01:04 tom Exp $")
 
 #define INDENT                 8
 #define DISCARD(string) string = ABSENT_STRING
@@ -156,17 +156,17 @@ _nc_leaks_dump_entry(void)
 #endif
 
 #define NameTrans(check,result) \
-           if (OkIndex(np->nte_index, check) \
+           if ((np->nte_index <= OK_ ## check) \
                && check[np->nte_index]) \
                return (result[np->nte_index])
 
 NCURSES_CONST char *
 nametrans(const char *name)
-/* translate a capability name from termcap to terminfo */
+/* translate a capability name to termcap from terminfo */
 {
     const struct name_table_entry *np;
 
-    if ((np = _nc_find_entry(name, _nc_get_hash_table(0))) != 0)
+    if ((np = _nc_find_entry(name, _nc_get_hash_table(0))) != 0) {
        switch (np->nte_type) {
        case BOOLEAN:
            NameTrans(bool_from_termcap, boolcodes);
@@ -180,6 +180,7 @@ nametrans(const char *name)
            NameTrans(str_from_termcap, strcodes);
            break;
        }
+    }
 
     return (0);
 }
@@ -777,6 +778,8 @@ fmt_entry(TERMTYPE *tterm,
                    trimmed_sgr0 = _nc_trim_sgr0(tterm);
                    if (strcmp(capability, trimmed_sgr0))
                        capability = trimmed_sgr0;
+                   else
+                       free(trimmed_sgr0);
 
                    set_attributes = my_sgr;
                }
index 64f98bdc0714c06a426816406a6d902a11f8d360..9974c33560ffca4c18c0174fa43d9b6c504cae2e 100644 (file)
@@ -37,7 +37,7 @@
 #define USE_LIBTINFO
 #include <progs.priv.h>
 
-MODULE_ID("$Id: tabs.c,v 1.36 2015/04/18 22:20:21 James.Clarke Exp $")
+MODULE_ID("$Id: tabs.c,v 1.37 2015/07/04 21:14:42 tom Exp $")
 
 static void usage(void) GCC_NORETURN;
 
@@ -288,6 +288,7 @@ add_to_tab_list(char **append, const char *value)
 
        *append = result;
     }
+    free(copied);
     return result;
 }
 
index 8182e2eea7aa9d8a0f2c1d4682bfac67c5d1dbe0..10cc4d2d606362fb6bb3b7f6e797fd032f763402 100644 (file)
@@ -48,7 +48,7 @@
 #include <parametrized.h>
 #include <transform.h>
 
-MODULE_ID("$Id: tic.c,v 1.210 2015/05/27 00:58:18 tom Exp $")
+MODULE_ID("$Id: tic.c,v 1.211 2015/07/04 21:12:41 tom Exp $")
 
 #define STDIN_NAME "<stdin>"
 
@@ -2337,13 +2337,15 @@ check_termtype(TERMTYPE *tp, bool literal)
                      ("will trim sgr0\n\toriginal sgr0=%s\n\ttrimmed  sgr0=%s",
                       _nc_visbuf2(1, exit_attribute_mode),
                       _nc_visbuf2(2, check_sgr0)));
-               free(check_sgr0);
            } else {
                DEBUG(2,
                      ("will not trim sgr0\n\toriginal sgr0=%s",
                       _nc_visbuf(exit_attribute_mode)));
            }
        }
+       if (check_sgr0 != exit_attribute_mode) {
+           free(check_sgr0);
+       }
     }
 #ifdef TRACE
     show_where(2);
index 04ea1b6b4c460154bb582c223bf3664b356caa1d..81de6c8d018e97473fe1049b4efce8e4c7275b13 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2014,2015 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            *
@@ -33,7 +33,7 @@
  * modified 10-18-89 for curses (jrl)
  * 10-18-89 added signal handling
  *
- * $Id: gdc.c,v 1.42 2014/08/09 22:28:42 tom Exp $
+ * $Id: gdc.c,v 1.44 2015/07/04 21:28:28 tom Exp $
  */
 
 #include <test.priv.h>
@@ -380,7 +380,11 @@ main(int argc, char *argv[])
 
        /* this depends on the detailed format of ctime(3) */
        (void) strncpy(buf, ctime(&now), (size_t) 30);
-       (void) strcpy(buf + 10, buf + 19);
+       {
+           char *d2 = buf + 10;
+           char *s2 = buf + 19;
+           while ((*d2++ = *s2++) != '\0') ;
+       }
        MvAddStr(16, 30, buf);
 
        move(6, 0);
index a1f00576e8befc9b73fdcbbb5fec2fcfdded1ca2..7a44a2c642cdb80e4229322411449b63f863a6ff 100644 (file)
@@ -6,7 +6,7 @@
  *  wrs(5/28/93) -- modified to be consistent (perform identically) with either
  *                  PDCurses or under Unix System V, R4
  *
- * $Id: testcurs.c,v 1.49 2014/07/27 00:25:14 tom Exp $
+ * $Id: testcurs.c,v 1.50 2015/07/05 00:11:10 tom Exp $
  */
 
 #include <test.priv.h>
@@ -437,7 +437,7 @@ inputTest(WINDOW *win)
            "%d %[][a-zA-Z]s",
            "%d %[^0-9]"
        };
-       const char *format = fmt[(unsigned) repeat % SIZEOF(fmt)];
+       char *format = strdup(fmt[(unsigned) repeat % SIZEOF(fmt)]);
 
        wclear(win);
        MvWAddStr(win, 3, 2, "The window should have moved");
@@ -453,12 +453,13 @@ inputTest(WINDOW *win)
        noraw();
        num = 0;
        *buffer = 0;
-       answered = mvwscanw(win, 7, 6, strdup(format), &num, buffer);
+       answered = mvwscanw(win, 7, 6, format, &num, buffer);
        MvWPrintw(win, 8, 6,
                  "String: %s Number: %d (%d values read)",
                  buffer, num, answered);
        Continue(win);
        ++repeat;
+       free(format);
     } while (answered > 0);
 }