1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-10 07:04:03 +00:00
freebsd-ports/archivers/unarj/files/patch-01-path-unarj.c
Andrey A. Chernov fc11092ea4 Close two vulnerabilities
Submitted by:   simon
2004-11-29 21:28:13 +00:00

26 lines
673 B
C

--- unarj-2.65.orig/unarj.c
+++ unarj.c
@@ -235,6 +235,8 @@ static UCRC crctable[UCHAR_MAX + 1];
/* Functions */
+void copy_path_relative(char *dest, char *src, size_t len);
+
static void
make_crctable()
{
@@ -738,11 +740,11 @@ extract()
no_output = 0;
if (command == 'E')
- strncopy(name, &filename[entry_pos], sizeof(name));
+ copy_path_relative(name, &filename[entry_pos], sizeof(name));
else
{
strcpy(name, DEFAULT_DIR);
- strncopy(name+strlen(name), filename, sizeof(name)-strlen(name));
+ copy_path_relative(name+strlen(name), filename, sizeof(name)-strlen(name));
}
if (host_os != OS)