summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sping@gentoo.org>2020-03-15 19:08:29 +0100
committerSebastian Pipping <sping@gentoo.org>2020-03-15 19:08:40 +0100
commit8721763f5c744e8eca229edfe1afd52a77cf2842 (patch)
treed46a077f467b714857e22a4c28d1ba10b5775bcb /dev-libs/iniparser/files
parentgnome-extra/pch-session: Drop old (diff)
downloadgentoo-8721763f5c744e8eca229edfe1afd52a77cf2842.tar.gz
gentoo-8721763f5c744e8eca229edfe1afd52a77cf2842.tar.bz2
gentoo-8721763f5c744e8eca229edfe1afd52a77cf2842.zip
dev-libs/iniparser: Fix out-of-bounds read
Bug: https://bugs.gentoo.org/647588 Signed-off-by: Sebastian Pipping <sping@gentoo.org> Package-Manager: Portage-2.3.92, Repoman-2.3.20
Diffstat (limited to 'dev-libs/iniparser/files')
-rw-r--r--dev-libs/iniparser/files/iniparser-4.0-out-of-bounds-read.patch22
1 files changed, 22 insertions, 0 deletions
diff --git a/dev-libs/iniparser/files/iniparser-4.0-out-of-bounds-read.patch b/dev-libs/iniparser/files/iniparser-4.0-out-of-bounds-read.patch
new file mode 100644
index 000000000000..962566cd5b7f
--- /dev/null
+++ b/dev-libs/iniparser/files/iniparser-4.0-out-of-bounds-read.patch
@@ -0,0 +1,22 @@
+From 4f870752abbb756911d7b11405d49e9769d082bd Mon Sep 17 00:00:00 2001
+From: Emmanuel Leblond <emmanuel.leblond@gmail.com>
+Date: Fri, 8 Apr 2016 22:13:36 +0200
+Subject: [PATCH] Fix #68 when reading file with only \0 char
+
+---
+ src/iniparser.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/iniparser.c b/src/iniparser.c
+index be37fec..fb1b549 100644
+--- a/src/iniparser.c
++++ b/src/iniparser.c
+@@ -678,7 +678,7 @@ dictionary * iniparser_load(const char * ininame)
+ while (fgets(line+last, ASCIILINESZ-last, in)!=NULL) {
+ lineno++ ;
+ len = (int)strlen(line)-1;
+- if (len==0)
++ if (len<=0)
+ continue;
+ /* Safety check against buffer overflows */
+ if (line[len]!='\n' && !feof(in)) {