blob: 5f7053e99c7583890a05dec9c628bd74999809af (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
$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;
|