22 lines
783 B
Plaintext
22 lines
783 B
Plaintext
$OpenBSD: patch-Utilities_cmtar_encode_c,v 1.2 2008/01/26 21:26:32 espie Exp $
|
|
--- Utilities/cmtar/encode.c.orig Mon Jan 21 19:59:58 2008
|
|
+++ Utilities/cmtar/encode.c Sat Jan 26 20:47:18 2008
|
|
@@ -91,7 +91,7 @@ th_set_path(TAR *t, char *pathname)
|
|
t->th_buf.gnu_longname = NULL;
|
|
|
|
if (pathname[strlen(pathname) - 1] != '/' && TH_ISDIR(t))
|
|
- strcpy(suffix, "/");
|
|
+ strlcpy(suffix, "/", sizeof suffix);
|
|
|
|
if (strlen(pathname)+strlen(suffix) >= T_NAMELEN && (t->options & TAR_GNU))
|
|
{
|
|
@@ -135,7 +135,7 @@ th_set_link(TAR *t, char *linkname)
|
|
{
|
|
/* GNU longlink format */
|
|
t->th_buf.gnu_longlink = strdup(linkname);
|
|
- strcpy(t->th_buf.linkname, "././@LongLink");
|
|
+ strlcpy(t->th_buf.linkname, "././@LongLink", sizeof t->th_buf.linkname);
|
|
}
|
|
else
|
|
{
|