summaryrefslogtreecommitdiff
blob: 581f5d5590e1b34c00d36f47064083973e71724a (plain)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
--- mpack-1.5.orig/decode.c
+++ mpack-1.5/decode.c
@@ -466,6 +466,7 @@
 	while (*from && *from != '\"') {
 	    if (!--left) {
 		alloced += VALUEGROWSIZE;
+		left += VALUEGROWSIZE;
 		value = xrealloc(value, alloced);
 		to = value + alloced - left - 2;
 	    }
@@ -482,6 +483,7 @@
 	while (*from && !isspace(*from)) {
 	    if (!--left) {
 		alloced += VALUEGROWSIZE;
+		left += VALUEGROWSIZE;
 		value = xrealloc(value, alloced);
 		to = value + alloced - left - 2;
 	    }
@@ -571,6 +573,7 @@
 	while (*disposition && *disposition != '\"') {
 	    if (!--left) {
 		alloced += VALUEGROWSIZE;
+		left += VALUEGROWSIZE;
 		value = xrealloc(value, alloced);
 		to = value + alloced - left - 2;
 	    }
@@ -588,6 +591,7 @@
 	       *disposition != '(') {
 	    if (!--left) {
 		alloced += VALUEGROWSIZE;
+		left += VALUEGROWSIZE;
 		value = xrealloc(value, alloced);
 		to = value + alloced - left - 2;
 	    }
--- mpack-1.5.orig/unixos.c
+++ mpack-1.5/unixos.c
@@ -89,7 +89,7 @@
 	strcpy(buf, getenv("TMPDIR"));
     }
     else {
-	strcpy(buf, "/usr/tmp");
+	strcpy(buf, "/var/tmp");
     }
     strcat(buf, "/m-prts-");
     p = getenv("USER");
@@ -159,6 +159,11 @@

     /* Get rid of leading ~ or ~/ */
     while (*fname == '~' || *fname == '/') fname++;
+
+    /* Debian fix: the loop below handles internal "/../" but not
+     * leading "../" */
+    /* Get rid of leading "../" */
+    while (!strncmp(fname, "../", 3)) fname += 3;

     /* Clean out bad characters, create directories along path */
     for (p=fname; *p; p++) {
--- mpack-1.5.orig/unixunpk.man
+++ mpack-1.5/unixunpk.man
@@ -107,7 +107,7 @@
 .SH ENVIRONMENT
 .TP
 .B TMPDIR
-Directory to store temporary files.  Default is /usr/tmp.
+Directory to store temporary files.  Default is /var/tmp.
 .SH FILES
 .TP
 .B $TMPDIR/m-prts-$USER/
--- mpack-1.5.orig/uudecode.c
+++ mpack-1.5/uudecode.c
@@ -524,8 +524,9 @@
      * representation syntax
      */
     do {
-	while (*scan != '\n' && isprint(*scan)
-	       && !isalnum(*scan) && *scan != '_') ++scan;
+        /* Debian patch: skip non-printable characters too.
+         * Sent upstream, no reply yet. */
+	while (*scan != '\n' && !isalnum(*scan) && *scan != '_') ++scan;
 	*fnamep = start = scan;
 	while (isalnum(*scan) || *scan == '-' || *scan == '+' || *scan == '&'
 	       || *scan == '_' || *scan == '.') {