From 4d547830056b72e750ebaf66e567b63d167551e1 Mon Sep 17 00:00:00 2001 From: songmingliang Date: Thu, 28 Nov 2024 11:01:49 +0800 Subject: [PATCH] add judgment condition of null --- 0001-add-judgment-condition-of-null.patch | 27 +++++++++++++++++++++++ cracklib.spec | 7 +++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 0001-add-judgment-condition-of-null.patch diff --git a/0001-add-judgment-condition-of-null.patch b/0001-add-judgment-condition-of-null.patch new file mode 100644 index 0000000..0a8e06a --- /dev/null +++ b/0001-add-judgment-condition-of-null.patch @@ -0,0 +1,27 @@ +From f060f0a5c60ad4e6bb9a04f1434600dd7193a1a3 Mon Sep 17 00:00:00 2001 +From: songmingliang +Date: Thu, 28 Nov 2024 10:58:31 +0800 +Subject: [PATCH] add judgment condition of null + +--- + lib/rules.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/lib/rules.c b/lib/rules.c +index d5a14b3..e6a872e 100644 +--- a/lib/rules.c ++++ b/lib/rules.c +@@ -434,6 +434,10 @@ Mangle(input, control, area) /* returns a pointer to a controlled Mangle */ + int limit; + char *ptr; + char area2[STRINGSIZE * 2] = {0}; ++ if(area == NULL){ ++ char t[STRINGSIZE]; ++ area = t; ++ } + strcpy(area, input); + + for (ptr = control; *ptr; ptr++) +-- +2.27.0 + diff --git a/cracklib.spec b/cracklib.spec index 65c00a9..4ce3425 100644 --- a/cracklib.spec +++ b/cracklib.spec @@ -1,3 +1,4 @@ +%define anolis_release .0.1 # Reflects the values hard-coded in various Makefile.am's in the source tree. %define dictdir %{_datadir}/cracklib %define dictpath %{dictdir}/pw_dict @@ -5,7 +6,7 @@ Summary: A password-checking library Name: cracklib Version: 2.9.11 -Release: 1%{?dist} +Release: 1%{anolis_release}%{?dist} URL: https://github.com/cracklib/cracklib License: LGPL-2.1-or-later @@ -18,6 +19,7 @@ Source3: missing-words.gz Patch: cracklib-2.9.11-packlib-reentrant.patch Patch: cracklib-2.9.11-simplistic.patch +Patch: 0001-add-judgment-condition-of-null.patch BuildRequires: gcc BuildRequires: words, gettext @@ -154,6 +156,9 @@ make test DESTDIR=%{buildroot} %{_sbindir}/mkdict %changelog +- Thu Oct 28 2024 songmingliang - 2.9.11-1.0.1 +- fix: add judgment condition of null + * Wed Mar 20 2024 yangxianzhao - 2.9.11-1 - Update to 2.9.11-1 -- Gitee