]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 5.9 - patch 20130504
authorThomas E. Dickey <dickey@invisible-island.net>
Sat, 4 May 2013 23:59:52 +0000 (23:59 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sat, 4 May 2013 23:59:52 +0000 (23:59 +0000)
+ fixes for issues found by Coverity:
  + correct FNKEY() macro in progs/dump_entry.c, allowing kf11-kf63 to
    display when infocmp's -R option is used for HP or AIX subsets.
  + fix dead-code issue with test/movewindow.c
  + improve limited-checking in _nc_read_termtype().

NEWS
dist.mk
ncurses/tinfo/read_entry.c
package/debian/changelog
package/ncurses.spec
progs/dump_entry.c
test/movewindow.c

diff --git a/NEWS b/NEWS
index 9f7b3888c52873b94a7ba1c50ee2f4197a3f9ec7..84da50c74ad406ac7920b321f923db98aaebbb74 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.2049 2013/04/27 21:56:59 tom Exp $
+-- $Id: NEWS,v 1.2053 2013/05/04 23:03:37 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,13 @@ 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.
 
+20130504
+       + fixes for issues found by Coverity:
+         + correct FNKEY() macro in progs/dump_entry.c, allowing kf11-kf63 to
+           display when infocmp's -R option is used for HP or AIX subsets.
+         + fix dead-code issue with test/movewindow.c
+         + improve limited-checking in _nc_read_termtype().
+
 20130427
        + fix clang 3.2 warning in progs/dump_entry.c
        + drop AC_TYPE_SIGNAL check; ncurses relies on c89 and later.
@@ -2706,7 +2713,7 @@ it is not possible to add this information.
        + modify configure script to quiet c++ build with libtool when the
          --disable-echo option is used.
        + modify configure script to disable ada95 if libtool is selected,
-         writing a warning message (addresses FreeBSD ports/114493).
+         writing a warning message (addresses FreeBSD #114493).
        + update config.guess, config.sub
 
 20070707
@@ -5272,7 +5279,7 @@ it is not possible to add this information.
        + modify lib_screen.c and lib_newwin.c to maintain the SCREEN-specific
          pointers for curscr/stdscr/newscr when scr_save() and scr_restore()
          modify the global curscr/stdscr/newscr variables.  Fixes Redhat
-         #68199 dated 2002-07-07.
+         #68199.
        + add checks for null pointer in calls to tparm() and tgoto() based on
          FreeBSD bug report.  If ncurses were built with termcap support, and
          the first call to tgoto() were a zero-length string, the result would
diff --git a/dist.mk b/dist.mk
index 4dea8d181897bf6986b839c848067237a05cc18d..28e3c60cc05d19d5b47c312e325db22fc8ca0568 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.925 2013/04/27 17:52:18 tom Exp $
+# $Id: dist.mk,v 1.926 2013/05/04 14:55:13 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 = 5
 NCURSES_MINOR = 9
-NCURSES_PATCH = 20130427
+NCURSES_PATCH = 20130504
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 47852ad1dcc3015451e306dea15200f0b5cfcc21..a74bfd75dcd50a49f6c7b483ba67cae2a9c1022c 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2012,2013 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            *
@@ -41,7 +41,7 @@
 
 #include <tic.h>
 
-MODULE_ID("$Id: read_entry.c,v 1.121 2012/11/18 01:18:47 tom Exp $")
+MODULE_ID("$Id: read_entry.c,v 1.122 2013/05/04 22:53:42 tom Exp $")
 
 #define TYPE_CALLOC(type,elts) typeCalloc(type, (unsigned)(elts))
 
@@ -124,7 +124,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit)
     int offset = 0;
     int name_size, bool_count, num_count, str_count, str_size;
     int i;
-    char buf[MAX_ENTRY_SIZE + 1];
+    char buf[MAX_ENTRY_SIZE + 2];
     char *string_table;
     unsigned want, have;
 
@@ -159,7 +159,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit)
     want = (unsigned) (str_size + name_size + 1);
     if (str_size) {
        /* try to allocate space for the string table */
-       if (str_count * 2 >= (int) sizeof(buf)
+       if (str_count * 2 >= MAX_ENTRY_SIZE
            || (string_table = typeMalloc(char, want)) == 0) {
            return (TGETENT_NO);
        }
@@ -238,9 +238,9 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit)
        unsigned need = (unsigned) (ext_bool_count + ext_num_count + ext_str_count);
        int base = 0;
 
-       if (need >= sizeof(buf)
-           || ext_str_size >= (int) sizeof(buf)
-           || ext_str_limit >= (int) sizeof(buf)
+       if (need >= (MAX_ENTRY_SIZE / 2)
+           || ext_str_size >= MAX_ENTRY_SIZE
+           || ext_str_limit >= MAX_ENTRY_SIZE
            || ext_bool_count < 0
            || ext_num_count < 0
            || ext_str_count < 0
index 9a594a960f181207b9e90c1f8ae45858acd66f9b..db1552f2364234c92e68cf10326aaf49b7de7cd1 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (5.9-20130427) unstable; urgency=low
+ncurses6 (5.9-20130504) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 20 Apr 2013 09:08:00 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 04 May 2013 10:55:57 -0400
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index 96f88eb00832543ae71834f7fa6299360cb9f338..25a13dc5341b894ff0548eaa3928c42bccc6efe8 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Release: 5.9
-Version: 20130427
+Version: 20130504
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{release}-%{version}.tgz
index 1fc9a890fa11cbe7701d562b7c3a33edb93364c9..241fc1dc82e38a4e513d21e34c6c04e8e52a5aeb 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.108 2013/04/27 21:45:19 tom Exp $")
+MODULE_ID("$Id: dump_entry.c,v 1.109 2013/05/04 18:48:56 tom Exp $")
 
 #define INDENT                 8
 #define DISCARD(string) string = ABSENT_STRING
@@ -309,7 +309,11 @@ dump_predicate(PredType type, PredIdx idx)
 static void set_obsolete_termcaps(TERMTYPE *tp);
 
 /* is this the index of a function key string? */
-#define FNKEY(i)       (((i)<= 65 && (i)>= 75) || ((i)<= 216 && (i)>= 268))
+#define FNKEY(i) \
+    (((i) >= STR_IDX(key_f0) && \
+      (i) <= STR_IDX(key_f9)) || \
+     ((i) >= STR_IDX(key_f11) && \
+      (i) <= STR_IDX(key_f63)))
 
 /*
  * If we configure with a different Caps file, the offsets into the arrays
index 612cb8823cb75cbabb200f2f9701654a5a72d1e2..9effda41a4da145f421aa376aa04f7f48d12cad1 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2006-2010,2012 Free Software Foundation, Inc.              *
+ * Copyright (c) 2006-2012,2013 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            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: movewindow.c,v 1.38 2012/12/15 18:36:40 tom Exp $
+ * $Id: movewindow.c,v 1.39 2013/05/04 19:41:02 tom Exp $
  *
  * Demonstrate move functions for windows and derived windows from the curses
  * library.
@@ -494,34 +494,32 @@ move_derwin(WINDOW *win)
 
     if (parent != 0) {
        bool top = (parent == stdscr);
-       if (!top) {
-           int min_col = top ? COL_MIN : 0;
-           int max_col = top ? COL_MAX : getmaxx(parent);
-           int min_line = top ? LINE_MIN : 0;
-           int max_line = top ? LINE_MAX : getmaxy(parent);
-           PAIR *tmp;
-           bool more;
-
-           show_derwin(win);
-           while ((tmp = selectcell(parent,
-                                    win,
-                                    min_line, min_col,
-                                    max_line, max_col,
-                                    TRUE,
-                                    &more)) != 0) {
-               if (mvderwin(win, tmp->y, tmp->x) != ERR) {
-                   refresh_all(win);
-                   doupdate();
-                   repaint_one(win);
-                   doupdate();
-                   result = TRUE;
-                   show_derwin(win);
-               } else {
-                   flash();
-               }
-               if (!more)
-                   break;
+       int min_col = top ? COL_MIN : 0;
+       int max_col = top ? COL_MAX : getmaxx(parent);
+       int min_line = top ? LINE_MIN : 0;
+       int max_line = top ? LINE_MAX : getmaxy(parent);
+       PAIR *tmp;
+       bool more;
+
+       show_derwin(win);
+       while ((tmp = selectcell(parent,
+                                win,
+                                min_line, min_col,
+                                max_line, max_col,
+                                TRUE,
+                                &more)) != 0) {
+           if (mvderwin(win, tmp->y, tmp->x) != ERR) {
+               refresh_all(win);
+               doupdate();
+               repaint_one(win);
+               doupdate();
+               result = TRUE;
+               show_derwin(win);
+           } else {
+               flash();
            }
+           if (!more)
+               break;
        }
     }
     head_line("done");