iniparser: patch to fix buffer overrun

This commit is contained in:
Jürgen Buchmüller 2015-11-01 22:31:58 +01:00
parent 1a6d09a0fe
commit 363235271b
2 changed files with 17 additions and 1 deletions

View file

@ -0,0 +1,16 @@
--- src/iniparser.c
+++ src/iniparser.c
@@ -66,7 +66,8 @@ static const char * strlwc(const char * in, char *out, unsigned len)
/*--------------------------------------------------------------------------*/
static char * _strdup(const char *s)
{
- char * copy = (char*) malloc(strlen(s));
+ char * copy = (char*) malloc(strlen(s) + 1);
+ if (copy)
- strcpy(copy, s);
+ strcpy(copy, s);
return copy ;
}
--
2.4.5

View file

@ -1,7 +1,7 @@
# Template file for 'iniparser'
pkgname=iniparser
version=4.0
revision=2
revision=3
build_style=gnu-makefile
hostmakedepends="doxygen chrpath"
short_desc="A free stand-alone ini file parsing library"