From cc7d9e82971ba12447e01c1f09ee7fbe12106d8d Mon Sep 17 00:00:00 2001 From: sxt1001 Date: Wed, 1 Jul 2020 09:28:17 +0800 Subject: [PATCH 1/2] update yaml file --- augeas.spec | 10 +++++++- augeas.yaml | 4 +-- ...reference-in-function-re_case_expand.patch | 25 +++++++++++++++++++ 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 huawei-avoid-NULL-pointer-dereference-in-function-re_case_expand.patch diff --git a/augeas.spec b/augeas.spec index e767da8..0a58ab7 100644 --- a/augeas.spec +++ b/augeas.spec @@ -1,6 +1,6 @@ Name: augeas Version: 1.12.0 -Release: 4 +Release: 5 Summary: Augeas is a configuration editing tool for changing configuration files License: LGPLv2+ URL: https://augeas.net/ @@ -11,6 +11,8 @@ Provides: bundled(gnulib) Provides: augeas-libs = %{version}-%{release} augeas-libs%{?_isa} = %{version}-%{release} Obsoletes: augeas-libs < %{version}-%{release} +Patch9000: huawei-avoid-NULL-pointer-dereference-in-function-re_case_expand.patch + %description Augeas is a configuration editing tool. It parses configuration files in their native formats and transforms them into a tree. Configuration changes are made by manipulating @@ -78,6 +80,12 @@ make check %doc %{_mandir}/man1/au*.1.gz %changelog +* Tue Sep 8 2020 chengguipeng - 1.12.0-5 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:avoid NULL pointer dereference in function re_case_expand + * Wed Dec 25 2019 openEuler Buildteam - 1.12.0-4 - Type:bugfix - ID:NA diff --git a/augeas.yaml b/augeas.yaml index f0b29a4..eb0ccf2 100644 --- a/augeas.yaml +++ b/augeas.yaml @@ -1,4 +1,4 @@ version_control: github src_repo: hercules-team/augeas -tag_prefix: -seperator: . +tag_prefix: ^release- +seperator: "." diff --git a/huawei-avoid-NULL-pointer-dereference-in-function-re_case_expand.patch b/huawei-avoid-NULL-pointer-dereference-in-function-re_case_expand.patch new file mode 100644 index 0000000..b202b39 --- /dev/null +++ b/huawei-avoid-NULL-pointer-dereference-in-function-re_case_expand.patch @@ -0,0 +1,25 @@ +From c13c26f415405e3203d91f601409497f8aa930dd Mon Sep 17 00:00:00 2001 +From: chengguipeng +Date: Thu, 3 Sep 2020 16:54:34 +0800 +Subject: [PATCH] 2 + +--- + src/fa.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/fa.c b/src/fa.c +index 8e1d7d4..7935041 100644 +--- a/src/fa.c ++++ b/src/fa.c +@@ -4447,7 +4447,7 @@ int fa_expand_nocase(const char *regexp, size_t regexp_len, + parse.rend = regexp + regexp_len; + parse.error = REG_NOERROR; + re = parse_regexp(&parse); +- if (parse.error != REG_NOERROR) ++ if (re == NULL) + return parse.error; + + r = re_case_expand(re); +-- +1.8.3.1 + -- Gitee From ed497452e06a4cce018f9ab793753157438d9126 Mon Sep 17 00:00:00 2001 From: chengguipeng Date: Fri, 11 Sep 2020 14:31:31 +0800 Subject: [PATCH 2/2] augeas: avoid NULL pointer dereference in function re_case_expand --- augeas.spec | 2 +- ...d-NULL-pointer-dereference-in-function-re_case_expand.patch | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) rename huawei-avoid-NULL-pointer-dereference-in-function-re_case_expand.patch => avoid-NULL-pointer-dereference-in-function-re_case_expand.patch (81%) diff --git a/augeas.spec b/augeas.spec index 0a58ab7..74607e4 100644 --- a/augeas.spec +++ b/augeas.spec @@ -11,7 +11,7 @@ Provides: bundled(gnulib) Provides: augeas-libs = %{version}-%{release} augeas-libs%{?_isa} = %{version}-%{release} Obsoletes: augeas-libs < %{version}-%{release} -Patch9000: huawei-avoid-NULL-pointer-dereference-in-function-re_case_expand.patch +Patch0001: avoid-NULL-pointer-dereference-in-function-re_case_expand.patch %description Augeas is a configuration editing tool. It parses configuration files in their native diff --git a/huawei-avoid-NULL-pointer-dereference-in-function-re_case_expand.patch b/avoid-NULL-pointer-dereference-in-function-re_case_expand.patch similarity index 81% rename from huawei-avoid-NULL-pointer-dereference-in-function-re_case_expand.patch rename to avoid-NULL-pointer-dereference-in-function-re_case_expand.patch index b202b39..f317b4e 100644 --- a/huawei-avoid-NULL-pointer-dereference-in-function-re_case_expand.patch +++ b/avoid-NULL-pointer-dereference-in-function-re_case_expand.patch @@ -2,7 +2,8 @@ From c13c26f415405e3203d91f601409497f8aa930dd Mon Sep 17 00:00:00 2001 From: chengguipeng Date: Thu, 3 Sep 2020 16:54:34 +0800 Subject: [PATCH] 2 - +Avoid NULL pointer dereference in function re_case_expand. +Because parse_regexp() will return NULL pointer when the input parameter is abnomal. --- src/fa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- Gitee