Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
675ea72e12
!10 [sync] PR-9: Fix possible buffer overflow in get_path
From: @openeuler-sync-bot 
Reviewed-by: @lyn1001 
Signed-off-by: @lyn1001
2023-11-29 08:37:38 +00:00
starlet-dx
9da947a944 Fix possible buffer overflow in get_path
(cherry picked from commit 1cb7dad7b4c456244dd50c9deecaa9c2bc989c1c)
2023-11-29 16:07:19 +08:00
openeuler-ci-bot
7432351481 !3 Fix source0
Merge pull request !3 from alan/master
2020-09-09 11:46:57 +08:00
kkkl12
d73d50aa8c remove old source package 2020-09-09 11:06:36 +08:00
kkkl12
c66840c088 Fix Source0 2020-09-09 09:28:22 +08:00
openeuler-ci-bot
7928c725a6 !2 add yaml file
Merge pull request !2 from Captain.Wei/master
2020-05-13 16:26:32 +08:00
Captain Wei
8bb51dce22 add yaml file 2020-05-11 10:03:25 +08:00
openeuler-ci-bot
2e83ac842a !1 init package
Merge pull request !1 from wisdoman/master
2020-02-14 17:12:37 +08:00
wisdoman
8a3cd12444 add libtool 2020-02-14 16:59:08 +08:00
wisdoman
2eff314cf2 init package 2020-02-14 12:38:23 +08:00
4 changed files with 102 additions and 0 deletions

View File

@ -0,0 +1,24 @@
From 6382711e9b0060bbd0408df512e48b2ce9cdb3be Mon Sep 17 00:00:00 2001
From: William Hubbs <w.d.hubbs@gmail.com>
Date: Tue, 22 Jun 2010 14:16:45 -0500
Subject: [PATCH] fix possible buffer overflow in get_path
If a pathname is longer than CFG_MAX_FILENAME, there was a possible
buffer overflow when copying the path name.
---
src/dotconf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/dotconf.c b/src/dotconf.c
index af553b3..7ba2001 100644
--- a/src/dotconf.c
+++ b/src/dotconf.c
@@ -1440,7 +1440,7 @@ char *get_path(char *name)
} else {
len = tmp - name + 1;
if (len > CFG_MAX_FILENAME)
- len -= 1;
+ len = CFG_MAX_FILENAME;
}
snprintf(buf, len, "%s", name);
return buf;

74
dotconf.spec Normal file
View File

@ -0,0 +1,74 @@
Name: dotconf
Version: 1.3
Release: 24
Summary: A configuration file parser
License: LGPLv2
URL: https://github.com/williamh/dotconf
Source: https://github.com/williamh/dotconf/archive/v%{version}.tar.gz
# https://github.com/williamh/dotconf/commit/6382711e9b0060bbd0408df512e48b2ce9cdb3be
Patch0: Fix-possible-buffer-overflow-in-get_path.patch
BuildRequires: findutils glibc-common make autoconf automake libtool
%description
The dotconf package contains a library used to handle configuration
files.
%package devel
Summary: Development files for dotconf
Requires: %{name} = %{version}-%{release}
Requires: pkgconf-pkg-config
%description devel
The dotconf-devel package contains libraries and header files for
developing applications that use dotconf.
%package help
Summary: Documents for dotconf
%description help
The dotconf-help package contains related documents.
%prep
%autosetup -n dotconf-%{version} -p1
%build
autoreconf -fiv
%configure --disable-static
%make_build
%install
%make_install
%delete_la
mv %{buildroot}/%{_docdir}/%{name} __doc_dir
%post
/sbin/ldconfig
%postun
/sbin/ldconfig
%files
%doc AUTHORS COPYING
%{_libdir}/libdotconf*.so.*
%files devel
%{_libdir}/libdotconf*.so
%{_includedir}/dotconf.h
%{_libdir}/pkgconfig/dotconf.pc
%files help
%doc README
%doc __doc_dir/*
%changelog
* Wed Nov 29 2023 yaoxin <yao_xin001@hoperun.com> - 1.3-24
- Fix possible buffer overflow in get_path
* Tue Sep 8 2020 liuweibo <liuweibo10@huawei.com> - 1.3-23
- Fix Source0
* Fri Feb 14 2020 Tianfei <tianfei16@huawei.com> - 1.3-22
- Package init

4
dotconf.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: github
src_repo: williamh/dotconf
tag_prefix: ^v
seperator: .

BIN
v1.3.tar.gz Normal file

Binary file not shown.