1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
--- 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)
|