void-packages/srcpkgs/iniparser/patches/fix-malloc_size.patch

17 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