freebsd-ports/archivers/gtar/files/patch-src::misc.c
Kris Kennaway 80b34183f1 Fix a security bug that allows extracted filenames to contain ".." and
bump PORTREVISION.

Submitted by:	naddy
2002-10-05 07:50:22 +00:00

32 lines
589 B
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

$FreeBSD$
--- src/misc.c.orig Mon Aug 27 01:14:26 2001
+++ src/misc.c Wed Oct 2 19:10:55 2002
@@ -214,6 +214,13 @@
return 0;
}
while (! ISSLASH (*p));
+
+ do
+ {
+ if (! *p++)
+ return 0;
+ }
+ while ( ISSLASH (*p));
}
}
@@ -549,10 +556,8 @@
chmod_error_details (char const *name, mode_t mode)
{
int e = errno;
- char buf[10];
- decode_mode (mode, buf);
- ERROR ((0, e, _("%s: Cannot change mode to %s"),
- quotearg_colon (name), buf));
+ ERROR ((0, e, _("%s: Cannot change mode to 0%o"),
+ quotearg_colon (name), mode));
}
void