void-packages/srcpkgs/iniparser/patches/fix-malloc_size.patch
2015-11-01 22:31:58 +01:00

16 lines
440 B
Diff

--- 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