$NetBSD: patch-ad,v 1.1.1.1 2004/10/29 17:26:18 erh Exp $ --- lib/tarfn.c.orig 2004-10-29 16:55:01.000000000 +0000 +++ lib/tarfn.c 2004-10-29 16:56:37.000000000 +0000 @@ -58,7 +58,8 @@ int len; char * str; - len = strnlen(s, size); + char *nul = memchr(s, 0, size); + len = nul ? (nul - s) : size; str = malloc(len + 1); memcpy(str, s, len); str[len] = 0;