Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
8d0e51f320
!14 [sync] PR-10: Fix CVE-2023-33461
From: @openeuler-sync-bot 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
2023-06-25 03:02:42 +00:00
wk333
6f11dd16d0 Fix CVE-2023-33461
(cherry picked from commit ae79b42632c78225b2638649aae87faa13505e8a)
2023-06-25 10:45:39 +08:00
openeuler-ci-bot
d0b5391239 !4 Modify license information
From: @wang--ge
Reviewed-by: @small_leek,@myeuler
Signed-off-by: @small_leek,@myeuler
2021-01-22 11:23:10 +08:00
wang--ge
00d7314360 modify license 2021-01-19 17:12:24 +08:00
openeuler-ci-bot
839a25560a !3 【轻量级 PR】:update source0
From: @liqingqing_1229
Reviewed-by: @love_hangzhou
Signed-off-by: @love_hangzhou
2020-10-15 14:46:01 +08:00
liqingqing_1229
f2f1b6ddb9 update source0 2020-10-13 15:49:42 +08:00
openeuler-ci-bot
c9100fbdf2 !2 add yaml file for iniparserx
Merge pull request !2 from fcwicky/master
2020-08-13 14:13:28 +08:00
fcwicky
15a2c50c78 add yaml file for ndevilla/iniparserx 2020-08-13 11:57:19 +08:00
openeuler-ci-bot
729e597ec4 !1 init package
Merge pull request !1 from myeuler/master
2020-06-03 18:43:45 +08:00
myeuler
a48c1d05d4 init package 2020-05-15 23:47:10 +08:00
4 changed files with 112 additions and 0 deletions

45
CVE-2023-33461.patch Normal file
View 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') {

BIN
iniparser-4.1.tar.gz Normal file

Binary file not shown.

63
iniparser.spec Normal file
View File

@ -0,0 +1,63 @@
#%global debug_package %{nil}
Name: iniparser
Version: 4.1
Release: 4
Summary: ini file parser
License: MIT and Zlib
URL: https://github.com/ndevilla/iniparser
Source0: https://github.com/ndevilla/iniparser/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0: CVE-2023-33461.patch
BuildRequires: gcc doxygen
%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.
%prep
%autosetup -n %{name}-%{version} -p1
%build
%make_build
cd doc;make
%install
install -d %{buildroot}/%{_includedir}/%{name}
install -m 644 -t %{buildroot}%{_includedir}/%{name} src/dictionary.h src/iniparser.h
install -d %{buildroot}/%{_libdir}
install -m 755 -t %{buildroot}%{_libdir}/ libiniparser.so.1
ln -s libiniparser.so.1 %{buildroot}%{_libdir}/libiniparser.so
install -d %{buildroot}/%{_docdir}/%{name}
cp -r example %{buildroot}/%{_docdir}/%{name}
cp -r html %{buildroot}/%{_docdir}/%{name}
%pre
%preun
%post
%postun
%check
%files
%license LICENSE
%doc README.md INSTALL AUTHORS FAQ-en.md FAQ-zhcn.md
%{_includedir}/*
%{_libdir}/*
%{_docdir}/*
%changelog
* Sun Jun 25 2023 wangkai <13474090681@163.com> - 4.1-4
- Fix CVE-2023-33461
* 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>
- Package init

4
iniparser.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: github
src_repo: ndevilla/iniparser
tag_prefix: "^v"
separator: "."