Compare commits
10 Commits
c9100fbdf2
...
a1e5c2323c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a1e5c2323c | ||
|
|
e6c74eb377 | ||
|
|
009519bb04 | ||
|
|
befbdaafa6 | ||
|
|
47d5c4887e | ||
|
|
924c03edf5 | ||
|
|
d0b5391239 | ||
|
|
00d7314360 | ||
|
|
839a25560a | ||
|
|
f2f1b6ddb9 |
45
CVE-2023-33461.patch
Normal file
45
CVE-2023-33461.patch
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
From ace9871f65d11b5d73f0b9ee8cf5d2807439442d Mon Sep 17 00:00:00 2001
|
||||||
|
From: Antonio <antoniolrt@gmail.com>
|
||||||
|
Date: Fri, 2 Jun 2023 15:03:10 -0300
|
||||||
|
Subject: [PATCH] Handle null return from iniparser_getstring
|
||||||
|
|
||||||
|
Origin: https://github.com/ndevilla/iniparser/pull/146
|
||||||
|
|
||||||
|
Fix handling of NULL returns from iniparser_getstring in
|
||||||
|
iniparser_getboolean, iniparser_getlongint and iniparser_getdouble,
|
||||||
|
avoiding a crash.
|
||||||
|
---
|
||||||
|
src/iniparser.c | 6 +++---
|
||||||
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/iniparser.c b/src/iniparser.c
|
||||||
|
index f1d1658..dbceb20 100644
|
||||||
|
--- a/src/iniparser.c
|
||||||
|
+++ b/src/iniparser.c
|
||||||
|
@@ -456,7 +456,7 @@ long int iniparser_getlongint(const dictionary * d, const char * key, long int n
|
||||||
|
const char * str ;
|
||||||
|
|
||||||
|
str = iniparser_getstring(d, key, INI_INVALID_KEY);
|
||||||
|
- if (str==INI_INVALID_KEY) return notfound ;
|
||||||
|
+ if (str==NULL || str==INI_INVALID_KEY) return notfound ;
|
||||||
|
return strtol(str, NULL, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -511,7 +511,7 @@ double iniparser_getdouble(const dictionary * d, const char * key, double notfou
|
||||||
|
const char * str ;
|
||||||
|
|
||||||
|
str = iniparser_getstring(d, key, INI_INVALID_KEY);
|
||||||
|
- if (str==INI_INVALID_KEY) return notfound ;
|
||||||
|
+ if (str==NULL || str==INI_INVALID_KEY) return notfound ;
|
||||||
|
return atof(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -553,7 +553,7 @@ int iniparser_getboolean(const dictionary * d, const char * key, int notfound)
|
||||||
|
const char * c ;
|
||||||
|
|
||||||
|
c = iniparser_getstring(d, key, INI_INVALID_KEY);
|
||||||
|
- if (c==INI_INVALID_KEY) return notfound ;
|
||||||
|
+ if (c==NULL || c==INI_INVALID_KEY) return notfound ;
|
||||||
|
if (c[0]=='y' || c[0]=='Y' || c[0]=='1' || c[0]=='t' || c[0]=='T') {
|
||||||
|
ret = 1 ;
|
||||||
|
} else if (c[0]=='n' || c[0]=='N' || c[0]=='0' || c[0]=='f' || c[0]=='F') {
|
||||||
34
CVE-2025-0633.patch
Normal file
34
CVE-2025-0633.patch
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
From 072a39a772a38c475e35a1be311304ca99e9de7f Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Lars=20M=C3=B6llendorf?= <lars@moellendorf.eu>
|
||||||
|
Date: Sun, 26 Jan 2025 08:48:23 +0100
|
||||||
|
Subject: [PATCH] Fix heap overflow in `iniparser_dumpsection_ini()`
|
||||||
|
|
||||||
|
Origin: https://gitlab.com/iniparser/iniparser/-/commit/072a39a772a38c475e35a1be311304ca99e9de7f
|
||||||
|
|
||||||
|
...reported in #177
|
||||||
|
|
||||||
|
As suggested by the issue reporter this is fixed by returning from
|
||||||
|
`iniparser_dumpsection_ini()` in case the length of the passed section name
|
||||||
|
of dictionary to dump was bigger than the size of the internal buffer used
|
||||||
|
to copy this string to.
|
||||||
|
|
||||||
|
Changelog: changed
|
||||||
|
---
|
||||||
|
src/iniparser.c | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
diff --git a/src/iniparser.c b/src/iniparser.c
|
||||||
|
index abc8b52..1086b46 100644
|
||||||
|
--- a/src/iniparser.c
|
||||||
|
+++ b/src/iniparser.c
|
||||||
|
@@ -327,6 +327,7 @@ void iniparser_dumpsection_ini(const dictionary * d, const char * s, FILE * f)
|
||||||
|
|
||||||
|
if (d==NULL || f==NULL) return ;
|
||||||
|
if (! iniparser_find_entry(d, s)) return ;
|
||||||
|
+ if (strlen(s) > sizeof(keym)) return;
|
||||||
|
|
||||||
|
seclen = (int)strlen(s);
|
||||||
|
fprintf(f, "\n[%s]\n", s);
|
||||||
|
--
|
||||||
|
GitLab
|
||||||
|
|
||||||
@ -1,22 +1,23 @@
|
|||||||
#%global debug_package %{nil}
|
|
||||||
|
|
||||||
Name: iniparser
|
Name: iniparser
|
||||||
Version: 4.1
|
Version: 4.1
|
||||||
Release: 1
|
Release: 6
|
||||||
Summary: ini file parser
|
Summary: ini file parser
|
||||||
License: MIT
|
License: MIT and Zlib
|
||||||
URL: https://github.com/ndevilla/iniparser
|
URL: https://github.com/ndevilla/iniparser
|
||||||
Source0: https://github.com/ndevilla/iniparser/archive/%{name}-%{version}.tar.gz
|
Source0: https://github.com/ndevilla/iniparser/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
||||||
|
Patch0: CVE-2023-33461.patch
|
||||||
|
Patch2: CVE-2025-0633.patch
|
||||||
|
|
||||||
BuildRequires: gcc doxygen
|
BuildRequires: gcc doxygen chrpath
|
||||||
|
|
||||||
%description
|
%description
|
||||||
This modules offers parsing of ini files from the C level. See a complete documentation in HTML format, from this directory open the file html/index.html with any HTML-capable browser.
|
This modules offers parsing of ini files from the C level. See a complete documentation in HTML format, from this directory open the file html/index.html with any HTML-capable browser.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n %{name}-%{version}/
|
%autosetup -n %{name}-%{version} -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
export CFLAGS="${RPM_OPT_FLAGS}"
|
||||||
%make_build
|
%make_build
|
||||||
cd doc;make
|
cd doc;make
|
||||||
|
|
||||||
@ -32,11 +33,16 @@ install -d %{buildroot}/%{_docdir}/%{name}
|
|||||||
cp -r example %{buildroot}/%{_docdir}/%{name}
|
cp -r example %{buildroot}/%{_docdir}/%{name}
|
||||||
cp -r html %{buildroot}/%{_docdir}/%{name}
|
cp -r html %{buildroot}/%{_docdir}/%{name}
|
||||||
|
|
||||||
|
chrpath -d %{buildroot}/%{_libdir}/libiniparser.so.1
|
||||||
|
mkdir -p %{buildroot}/etc/ld.so.conf.d
|
||||||
|
echo "%{_libdir}" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf
|
||||||
|
|
||||||
%pre
|
%pre
|
||||||
%preun
|
%preun
|
||||||
%post
|
%post
|
||||||
|
/sbin/ldconfig
|
||||||
%postun
|
%postun
|
||||||
|
/sbin/ldconfig
|
||||||
|
|
||||||
%check
|
%check
|
||||||
|
|
||||||
@ -46,8 +52,25 @@ cp -r html %{buildroot}/%{_docdir}/%{name}
|
|||||||
%{_includedir}/*
|
%{_includedir}/*
|
||||||
%{_libdir}/*
|
%{_libdir}/*
|
||||||
%{_docdir}/*
|
%{_docdir}/*
|
||||||
|
%config(noreplace) /etc/ld.so.conf.d/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Mar 07 2025 wangkai <13474090681@163.com> - 4.1-6
|
||||||
|
- Fix CVE-2025-0633
|
||||||
|
|
||||||
|
* Sun Jun 25 2023 wangkai <13474090681@163.com> - 4.1-5
|
||||||
|
- Fix CVE-2023-33461
|
||||||
|
|
||||||
|
* Mon Aug 22 2022 yaoxin <yaoxin20@h-partners.com> - 4.1-4
|
||||||
|
- Fix not striped problem
|
||||||
|
- Remove rpath
|
||||||
|
|
||||||
|
* Tue Jan 19 2021 Ge Wang <wangge20@huawei.com> - 4.1-3
|
||||||
|
- Modify license information.
|
||||||
|
|
||||||
|
* Tue Oct 13 2020 liqingqing_1229 <liqingqing3@huawei.com>
|
||||||
|
- update source0
|
||||||
|
|
||||||
* Sun Mar 29 2020 Wei Xiong <myeuler@163.com>
|
* Sun Mar 29 2020 Wei Xiong <myeuler@163.com>
|
||||||
- Package init
|
- Package init
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user