iniparser: patch to fix buffer overrun
This commit is contained in:
parent
1a6d09a0fe
commit
363235271b
2 changed files with 17 additions and 1 deletions
16
srcpkgs/iniparser/patches/fix-malloc_size.patch
Normal file
16
srcpkgs/iniparser/patches/fix-malloc_size.patch
Normal 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
|
||||
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue