shithub: scc

Download patch

ref: 328f45d5dcadced32eaeee1ea0a6f05f7cb2a969
parent: fe3c00a2d48a2f6d7d66231cb5edecb0c5ccf778
author: Roberto E. Vargas Caballero <[email protected]>
date: Tue Apr 15 16:51:47 EDT 2014

Copy end of string in xstrdup

the size of a string is length of the string + 1 due to the
end of string.

--- a/wrapper.c
+++ b/wrapper.c
@@ -36,7 +36,7 @@
 char *
 xstrdup(const char *s)
 {
-	register size_t len = strlen(s);
+	register size_t len = strlen(s) + 1;
 	register char *p = xmalloc(len);
 
 	return memcpy(p, s, len);