From e81f11ea817dfbcdcc7bbbac7a0d087645c19d2e Mon Sep 17 00:00:00 2001 From: yangchen_guang Date: Thu, 25 Nov 2021 11:37:28 +0800 Subject: [PATCH] Fix gdbmtool parm import error --- Fix-gdbmtool-import-command.patch | 36 +++++++++++++++++++++++++++++++ gdbm.spec | 7 +++++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 Fix-gdbmtool-import-command.patch diff --git a/Fix-gdbmtool-import-command.patch b/Fix-gdbmtool-import-command.patch new file mode 100644 index 0000000..91d9339 --- /dev/null +++ b/Fix-gdbmtool-import-command.patch @@ -0,0 +1,36 @@ +From 4f456e7c4b9e3727a83bc3d30ac929402f7ef81a Mon Sep 17 00:00:00 2001 +From: yangchenguang +Date: Fri, 19 Nov 2021 10:44:24 +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 bbadbae..03ba482 100644 +--- a/src/gdbmtool.c ++++ b/src/gdbmtool.c +@@ -1003,7 +1003,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; +@@ -1054,7 +1054,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.20.1 + diff --git a/gdbm.spec b/gdbm.spec index 06b67ba..c56a7f5 100644 --- a/gdbm.spec +++ b/gdbm.spec @@ -1,12 +1,14 @@ Name: gdbm Version: 1.18.1 -Release: 2 +Release: 3 Epoch: 1 Summary: A library of database functions that work similar to the standard UNIX dbm License: GPLv3+ URL: http://www.gnu.org/software/gdbm/ Source0: http://ftp.gnu.org/gnu/gdbm/gdbm-%{version}.tar.gz +Patch0: Fix-gdbmtool-import-command.patch + BuildRequires: gcc libtool gettext readline-devel git Provides: %{name}-libs @@ -97,6 +99,9 @@ fi %{_infodir}/*.info* %changelog +* Thu Nov 25 2021 yangchenguang - 1.18.1-3 +- Fix gdbmtool parm import error + * Fri Oct 29 2021 yanglongkang - 1.18.1-2 - The devel package dependency is added to the devel package to resolve the installation error -- Gitee