diff --git a/0001-Fix-gdbmtool-import-command.patch b/0001-Fix-gdbmtool-import-command.patch new file mode 100644 index 0000000000000000000000000000000000000000..c5bfba991926522b0845e6935a0aa90f08ec4cd1 --- /dev/null +++ b/0001-Fix-gdbmtool-import-command.patch @@ -0,0 +1,36 @@ +From 0613cb67c8da8a575ec39ec02226fdbb1f6283f0 Mon Sep 17 00:00:00 2001 +From: yangchenguang +Date: Fri, 19 Nov 2021 11:08:09 +0800 +Subject: [PATCH] Fix gdbmtool import command + +* src/gdbmtool.c (import_handler): Fix option addressing (see +https://puszcza.gnu.org.ua/bugs/?535). +Fix freeing of the uninitialized variable. +--- + src/gdbmtool.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/src/gdbmtool.c b/src/gdbmtool.c +index 7fbecc0..d63a2f1 100644 +--- a/src/gdbmtool.c ++++ b/src/gdbmtool.c +@@ -948,7 +948,7 @@ import_handler (struct handler_param *param) + int i; + int rc; + +- for (i = 0; i < param->argc; i++) ++ for (i = 1; i < param->argc; i++) + { + if (strcmp (PARAM_STRING (param, i), "replace") == 0) + flag = GDBM_REPLACE; +@@ -999,7 +999,6 @@ import_handler (struct handler_param *param) + return; + } + +- free (file_name); + if (gdbm_setopt (gdbm_file, GDBM_GETDBNAME, &file_name, sizeof (file_name))) + terror (_("gdbm_setopt failed: %s"), gdbm_strerror (gdbm_errno)); + } +-- +2.27.0 + diff --git a/gdbm.spec b/gdbm.spec index c986bb123cca97dfc8a33965b2bdcff98324fc17..ff9a9a9c63d370de20902a8009bc7a5f63b1e8d8 100644 --- a/gdbm.spec +++ b/gdbm.spec @@ -1,6 +1,6 @@ Name: gdbm Version: 1.20 -Release: 3 +Release: 4 Epoch: 1 Summary: A library of database functions that work similar to the standard UNIX dbm License: GPLv3+ @@ -8,6 +8,8 @@ URL: http://www.gnu.org/software/gdbm/ Source0: http://ftp.gnu.org/gnu/gdbm/gdbm-%{version}.tar.gz Patch0: 0000-fix-gdbm_dump-usage-stack-overflow.patch +Patch1: 0001-Fix-gdbmtool-import-command.patch + BuildRequires: gcc libtool gettext readline-devel @@ -98,6 +100,9 @@ fi %{_infodir}/*.info* %changelog +* Fri Nov 19 2021 yangchenguang - 1.20-4 +- DESC: fix gdbmtool import command + * Fri Sep 10 2021 geruijun - 1.20-3 - DESC: fix stack overflow in print_usage