]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 6.3 - patch 20220423
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 24 Apr 2022 00:17:21 +0000 (00:17 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 24 Apr 2022 00:17:21 +0000 (00:17 +0000)
+ in-progress work on invalid_merge(), disable it (cf: 20220402).
+ fix memory leak in _nc_tic_dir() when called from _nc_set_writedir().
+ fix memory leak in tic when "-c" option is used.

14 files changed:
NEWS
VERSION
dist.mk
ncurses/tinfo/comp_parse.c
ncurses/tinfo/db_iterator.c
ncurses/tinfo/write_entry.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 4e47245a0cc08ff6ee4a94be4a5f59a400316d75..0c1a85a308abb361bd4db51e210bf823a5605938 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -26,7 +26,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.3796 2022/04/16 23:31:41 tom Exp $
+-- $Id: NEWS,v 1.3798 2022/04/23 23:26:44 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -46,6 +46,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.
 
+20220423
+       + in-progress work on invalid_merge(), disable it (cf: 20220402).
+       + fix memory leak in _nc_tic_dir() when called from _nc_set_writedir().
+       + fix memory leak in tic when "-c" option is used.
+
 20220416
        + add a limit-check to guard against corrupt terminfo data
          (report/testcase by NCNIPC of China).
diff --git a/VERSION b/VERSION
index 687f5313abce7742e219d5cbfd7d64e4f7f52ebb..d25d13482abf3ad82a07e456394f0735d91783a0 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5:0:10 6.3     20220416
+5:0:10 6.3     20220423
diff --git a/dist.mk b/dist.mk
index bc97ee6ae2f085fa650d1fb7d6a3d562addb2102..28d529548c64c2bfc4887fe42bb1194f6ede8085 100644 (file)
--- 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.1475 2022/04/16 12:59:30 tom Exp $
+# $Id: dist.mk,v 1.1476 2022/04/23 12:44:18 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 = 3
-NCURSES_PATCH = 20220416
+NCURSES_PATCH = 20220423
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 7d02a90c10fb015812f6258ebb305a40788601dd..4951377fc43cdea5c510e97418eda31520cef11b 100644 (file)
@@ -48,7 +48,7 @@
 
 #include <tic.h>
 
-MODULE_ID("$Id: comp_parse.c,v 1.114 2022/04/02 22:13:54 tom Exp $")
+MODULE_ID("$Id: comp_parse.c,v 1.116 2022/04/23 23:23:38 tom Exp $")
 
 static void sanity_check2(TERMTYPE2 *, bool);
 NCURSES_IMPEXP void (NCURSES_API *_nc_check_termtype2) (TERMTYPE2 *, bool) = sanity_check2;
@@ -266,7 +266,7 @@ _nc_read_entry_source(FILE *fp, char *buf,
     _nc_suppress_warnings = oldsuppress;
 }
 
-#if NCURSES_XNAMES
+#if 0 && NCURSES_XNAMES
 static unsigned
 find_capname(TERMTYPE2 *p, const char *name)
 {
@@ -631,6 +631,14 @@ _nc_resolve_uses2(bool fullresolve, bool literal)
 
                _nc_check_termtype2(&qp->tterm, literal);
 
+               /*
+                * Checking calls tparm, which can allocate memory.  Fix leaks.
+                */
+#define TPS(name) fake_tm.tparm_state.name
+               FreeAndNull(TPS(out_buff));
+               FreeAndNull(TPS(fmt_buff));
+#undef TPS
+
                _nc_set_screen(save_SP);
                set_curterm(save_tm);
            } else {
index f0726682c40304151005374a458be949c48238fb..e69e0f34e71ccc66ff6ef26a50b790fcb02f3554 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey                                     *
+ * Copyright 2018-2020,2022 Thomas E. Dickey                                *
  * Copyright 2006-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -44,7 +44,7 @@
 #include <hashed_db.h>
 #endif
 
-MODULE_ID("$Id: db_iterator.c,v 1.48 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: db_iterator.c,v 1.49 2022/04/23 20:03:15 tom Exp $")
 
 #define HaveTicDirectory _nc_globals.have_tic_directory
 #define KeepTicDirectory _nc_globals.keep_tic_directory
@@ -202,6 +202,13 @@ free_cache(void)
     FreeAndNull(my_list);
 }
 
+static void
+update_tic_dir(const char *update)
+{
+    free((char *) TicDirectory);
+    TicDirectory = update;
+}
+
 /*
  * Record the "official" location of the terminfo directory, according to
  * the place where we're writing to, or the normal default, if not.
@@ -211,8 +218,9 @@ _nc_tic_dir(const char *path)
 {
     T(("_nc_tic_dir %s", NonNull(path)));
     if (!KeepTicDirectory) {
-       if (path != 0) {
-           TicDirectory = path;
+       if (path != NULL) {
+           if (path != TicDirectory)
+               update_tic_dir(strdup(path));
            HaveTicDirectory = TRUE;
        } else if (HaveTicDirectory == 0) {
            if (use_terminfo_vars()) {
@@ -444,5 +452,6 @@ _nc_db_iterator_leaks(void)
        FreeIfNeeded(my_vars[which].value);
        my_vars[which].value = 0;
     }
+    update_tic_dir(NULL);
 }
 #endif
index 05fea946113f914b6b2c8a1008e01fab689d8c96..e1baf9e2325dc7474cb64aebd2d1b2998002c922 100644 (file)
@@ -51,7 +51,7 @@
 #define TRACE_NUM(n)           /* nothing */
 #endif
 
-MODULE_ID("$Id: write_entry.c,v 1.119 2022/02/26 20:59:58 tom Exp $")
+MODULE_ID("$Id: write_entry.c,v 1.120 2022/04/23 19:59:10 tom Exp $")
 
 static int total_written;
 static int total_parts;
@@ -248,7 +248,7 @@ _nc_set_writedir(const char *dir)
        || getcwd(actual, sizeof(actual)) == 0)
        _nc_err_abort("%s: not a directory", destination);
 #endif
-    _nc_keep_tic_dir(strdup(actual));
+    _nc_keep_tic_dir(actual);
 }
 
 /*
index 03bde70484cab24693dc0fcaf01a36e15417e5cd..2a2f2312946121f173384ae26f2ab3b621688111 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.3+20220416) unstable; urgency=low
+ncurses6 (6.3+20220423) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 16 Apr 2022 08:59:30 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 23 Apr 2022 08:44:18 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index 03bde70484cab24693dc0fcaf01a36e15417e5cd..2a2f2312946121f173384ae26f2ab3b621688111 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.3+20220416) unstable; urgency=low
+ncurses6 (6.3+20220423) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 16 Apr 2022 08:59:30 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 23 Apr 2022 08:44:18 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index 3ac34a1e5a8c924b0d32905e7ba4e7183f3f9ce6..8847c82cb288104809bd5a7c7caa1622602782b3 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.3+20220416) unstable; urgency=low
+ncurses6 (6.3+20220423) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 16 Apr 2022 08:59:30 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 23 Apr 2022 08:44:18 -0400
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index 6dd8ba2394ae46cbc04f9e7cb8a5845c34eded28..b92882c320ada8b567992f837610f1c04eb42e4c 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.515 2022/04/16 12:59:30 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.516 2022/04/23 12:44:18 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 "3"\r
 !define VERSION_YYYY  "2022"\r
-!define VERSION_MMDD  "0416"\r
+!define VERSION_MMDD  "0423"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index 1028ce587e71c14639670ae7a560a4c09ad9a29f..9537593d87abf5ea2285381d8ff431d4ef25608c 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.3
-Release: 20220416
+Release: 20220423
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 43c39805cef64cb325ff5b597f93c2a1a43cc776..e9e42a111c2289c6873cc729476d99fdfe642192 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.3
-Release: 20220416
+Release: 20220423
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 8a57c8c8a4051965bf86b81fbb6ab138b99821fd..d5529f1619715bf645ed708bdadce625bf4821ca 100644 (file)
@@ -1,7 +1,7 @@
 Summary: Curses library with POSIX thread support.
 Name: ncursest6
 Version: 6.3
-Release: 20220416
+Release: 20220423
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index c8736c30e0c95be05e4cd5eba6de603933ae5abf..152010d260c416872a158f50ef2b7fb16f8d6215 100644 (file)
@@ -49,7 +49,7 @@
 #include <parametrized.h>
 #include <transform.h>
 
-MODULE_ID("$Id: tic.c,v 1.310 2022/04/09 22:17:45 tom Exp $")
+MODULE_ID("$Id: tic.c,v 1.311 2022/04/23 19:47:57 tom Exp $")
 
 #define STDIN_NAME "<stdin>"
 
@@ -644,7 +644,7 @@ show_databases(const char *outdir)
     const char *tried = 0;
 
     if (outdir == NULL) {
-       outdir = _nc_tic_dir(0);
+       outdir = _nc_tic_dir(NULL);
     }
     if ((result = valid_db_path(outdir)) != 0) {
        printf("%s\n", result);
@@ -1081,7 +1081,7 @@ main(int argc, char *argv[])
        if (total != 0)
            fprintf(log_fp, "%d entries written to %s\n",
                    total,
-                   _nc_tic_dir((char *) 0));
+                   _nc_tic_dir(NULL));
        else
            fprintf(log_fp, "No entries written\n");
     }