Here's a chunk of patches fixing various bugs in libpayload. Content-Disposition: inline; filename=fix-strdup.patch
Signed-off-by: Jordan Crouse jordan.crouse@amd.com Index: libpayload/libc/string.c =================================================================== --- libpayload.orig/libc/string.c 2008-04-24 17:58:11.000000000 -0600 +++ libpayload/libc/string.c 2008-04-24 17:58:04.000000000 -0600 @@ -173,11 +173,12 @@ char *strdup(const char *s) { int n = strlen(s); - char *p = malloc(n); + char *p = malloc(n + 1);
if (p != NULL) strncpy(p, s, n);
+ p[n] = 0; return p; }