Previously, in the function getreqentry, if(p-res==targetlen) a null
character would be written to the char after the target buffer.
-- 
Adria Garriga <[email protected]>
diff --git a/quark.c b/quark.c
index 917b3d4..4622981 100644
--- a/quark.c
+++ b/quark.c
@@ -409,7 +409,7 @@ getreqentry(char *name, char *target, size_t targetlen, char *breakchars) {
 		for(p = res; *p && !strchr(breakchars, *p); ++p);
 		if(!*p)
 			return 1;
-		if((size_t)(p - res) > targetlen)
+		if((size_t)(p - res) >= targetlen)
 			return 1;
 		memcpy(target, res, p - res);
 		target[p - res] = 0;

Reply via email to