aboutsummaryrefslogtreecommitdiffstats
path: root/packages/opkg/files/opkg_unarchive.patch
blob: a147cc87eeedca04bc76ef3a24ba06d4cec764f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--- trunk/libbb/unarchive.c.orig	2006/01/25 00:08:53	13584
+++ trunk/libbb/unarchive.c	2006/02/20 19:28:53	14150
@@ -120,10 +108,14 @@
 		linkname = NULL;
 	} else
 #endif
-	if (tar.formated.prefix[0] == 0) {
-		file_header->name = strdup(tar.formated.name);
-	} else {
-		file_header->name = concat_path_file(tar.formated.prefix, tar.formated.name);
+	{
+		file_header->name = strndup(tar.formated.name,100);
+
+		if (tar.formated.prefix[0]) {
+			char *temp = file_header->name;
+			file_header->name = concat_path_file(tar.formated.prefix, temp);
+			free(temp);
+		}
 	}
 
 	file_header->uid = strtol(tar.formated.uid, NULL, 8);