diff --git a/Fix-gdbmtool-import-command.patch b/Fix-gdbmtool-import-command.patch new file mode 100644 index 0000000000000000000000000000000000000000..c399d1463eceb2fff5ec710a3804a950f7b64324 --- /dev/null +++ b/Fix-gdbmtool-import-command.patch @@ -0,0 +1,45 @@ +From f3c7872fed5e0782438d186ac88c63035a637462 Mon Sep 17 00:00:00 2001 +From: Sergey Poznyakoff +Date: Thu, 18 Nov 2021 12:22:59 +0200 +Subject: Fix gdbmtool import command + +* src/gdbmshell.c (import_handler): Fix option addressing (see +https://puszcza.gnu.org.ua/bugs/?535). +Fix freeing of the uninitialized variable. +--- + src/gdbmshell.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/src/gdbmshell.c b/src/gdbmshell.c +index 08042ce..96b5844 100644 +--- a/src/gdbmshell.c ++++ b/src/gdbmshell.c +@@ -661,7 +661,7 @@ err_printer (void *data GDBM_ARG_UNUSED, char const *fmt, ...) + fprintf (stderr, "\n"); + } + +-/* recover sumamry verbose backup max-failed-keys=N max-failed-buckets=N max-failures=N */ ++/* recover summary verbose backup max-failed-keys=N max-failed-buckets=N max-failures=N */ + static int + recover_handler (struct command_param *param, struct command_environ *cenv) + { +@@ -1585,7 +1585,7 @@ import_handler (struct command_param *param, + int rc = GDBMSHELL_OK; + char *file_name; + +- 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; +@@ -1637,7 +1637,6 @@ import_handler (struct command_param *param, + return GDBMSHELL_GDBM_ERR; + } + +- free (file_name); + if (gdbm_setopt (gdbm_file, GDBM_GETDBNAME, &file_name, sizeof (file_name))) + { + dberror ("%s", "GDBM_GETDBNAME"); +-- +cgit v1.2.1 + diff --git a/gdbm.spec b/gdbm.spec index 2117fcd371430cdf6a8a1eb75b32bcbe038a009e..6d9212b92250be3ccfd125b1d1f978e07b4fada2 100644 --- a/gdbm.spec +++ b/gdbm.spec @@ -1,12 +1,14 @@ Name: gdbm Version: 1.22 -Release: 1 +Release: 2 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 Provides: %{name}-libs @@ -96,6 +98,9 @@ fi %{_infodir}/*.info* %changelog +* Thu Dec 09 2021 yangchenguang - 1.22-2 +- Fix gdbmtool parm import error + * Wed Nov 17 2021 Wenchao Hao - 1.22-1 - Update to gdbm-1.22