From defc2cd0f04e4bf5abf0c5a3b78a65230ee52564 Mon Sep 17 00:00:00 2001 From: xingwei Date: Fri, 10 Mar 2023 07:20:05 +0000 Subject: [PATCH] add fclose operation to fix file pointer not closed after use --- ...ation-to-fix-file-pointer-not-closed.patch | 77 +++++++++++++++++++ ppp.spec | 9 ++- 2 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 add-fclose-operation-to-fix-file-pointer-not-closed.patch diff --git a/add-fclose-operation-to-fix-file-pointer-not-closed.patch b/add-fclose-operation-to-fix-file-pointer-not-closed.patch new file mode 100644 index 0000000..ecf814b --- /dev/null +++ b/add-fclose-operation-to-fix-file-pointer-not-closed.patch @@ -0,0 +1,77 @@ +From 894fd6a7ba225936f7711ef9a9413bba65f83b92 Mon Sep 17 00:00:00 2001 +From: Wei Xing +Date: Thu, 2 Mar 2023 21:07:10 +0800 +Subject: [PATCH] Add fclose operation to fix file pointer not closed after use + Signed-off-by: Wei Xing + +--- + pppd/plugins/radius/clientid.c | 2 ++ + pppd/plugins/radius/config.c | 6 ++++++ + 2 files changed, 8 insertions(+) + +diff --git a/pppd/plugins/radius/clientid.c b/pppd/plugins/radius/clientid.c +index b1bbc47..eea5165 100644 +--- a/pppd/plugins/radius/clientid.c ++++ b/pppd/plugins/radius/clientid.c +@@ -68,6 +68,7 @@ int rc_read_mapfile(char *filename) + + if ((p = (struct map2id_s *)malloc(sizeof(*p))) == NULL) { + novm("rc_read_mapfile"); ++ fclose(mapfd); + return (-1); + } + +@@ -79,6 +80,7 @@ int rc_read_mapfile(char *filename) + } else { + + error("rc_read_mapfile: malformed line in %s, line %d", filename, lnr); ++ fclose(mapfd); + return (-1); + + } +diff --git a/pppd/plugins/radius/config.c b/pppd/plugins/radius/config.c +index 47c172c..39744fc 100644 +--- a/pppd/plugins/radius/config.c ++++ b/pppd/plugins/radius/config.c +@@ -212,6 +212,7 @@ int rc_read_config(char *filename) + + if ((pos = strcspn(p, "\t ")) == 0) { + error("%s: line %d: bogus format: %s", filename, line, p); ++ fclose(configfd); + return (-1); + } + +@@ -224,6 +225,7 @@ int rc_read_config(char *filename) + + if (option->status != ST_UNDEF) { + error("%s: line %d: duplicate option line: %s", filename, line, p); ++ fclose(configfd); + return (-1); + } + +@@ -234,18 +236,22 @@ int rc_read_config(char *filename) + switch (option->type) { + case OT_STR: + if (set_option_str(filename, line, option, p) < 0) ++ fclose(configfd); + return (-1); + break; + case OT_INT: + if (set_option_int(filename, line, option, p) < 0) ++ fclose(configfd); + return (-1); + break; + case OT_SRV: + if (set_option_srv(filename, line, option, p) < 0) ++ fclose(configfd); + return (-1); + break; + case OT_AUO: + if (set_option_auo(filename, line, option, p) < 0) ++ fclose(configfd); + return (-1); + break; + default: +-- +2.33.0 + diff --git a/ppp.spec b/ppp.spec index f0cc864..c4f6602 100644 --- a/ppp.spec +++ b/ppp.spec @@ -1,6 +1,6 @@ Name: ppp Version: 2.4.9 -Release: 4 +Release: 5 Summary: The Point-to-Point Protocol License: BSD and LGPLv2+ and GPLv2+ and Public Domain @@ -46,6 +46,7 @@ Patch0016: backport-ppp-2.4.9-configure-cflags-allow-commas.patch Patch0017: backport-0027-Set-LIBDIR-for-RISCV.patch Patch0018: backport-pppd-Negotiate-IP-address-when-only-peer-addresses-are-provided.patch Patch0019: backport-CVE-2022-4603.patch +Patch0020: add-fclose-operation-to-fix-file-pointer-not-closed.patch %description The Point-to-Point Protocol (PPP) provides a standard way to establish @@ -141,6 +142,12 @@ mkdir -p %{buildroot}%{_rundir}/lock/ppp %{_mandir}/man8/*.8.gz %changelog +* Fri Mar 10 2023 xingwei - 2.4.9-5 +- Type:bufix +- ID:NA +- SUG:NA +- DESC:add fclose operation to fix file pointer not closed after use + * Tue Feb 28 2023 laokz - 2.4.9-4 - Type:bugfix - ID:NA -- Gitee