pkgutils/libtar-1.2.11-fix_linkname_overflow.patch
2005-11-11 23:40:48 +01:00

36 lines
1.2 KiB
Diff

diff -ru libtar-1.2.11/lib/decode.c libtar-1.2.11-new/lib/decode.c
--- libtar-1.2.11/lib/decode.c 2004-08-18 22:12:06.888107160 +0200
+++ libtar-1.2.11-new/lib/decode.c 2004-08-18 22:05:27.569812768 +0200
@@ -42,6 +42,17 @@
return filename;
}
+char*
+th_get_linkname(TAR* t)
+{
+ static char filename[MAXPATHLEN];
+
+ if (t->th_buf.gnu_longlink)
+ return t->th_buf.gnu_longlink;
+
+ snprintf(filename, sizeof(filename), "%.100s", t->th_buf.linkname);
+ return filename;
+}
uid_t
th_get_uid(TAR *t)
diff -ru libtar-1.2.11/lib/libtar.h libtar-1.2.11-new/lib/libtar.h
--- libtar-1.2.11/lib/libtar.h 2003-01-07 02:40:59.000000000 +0100
+++ libtar-1.2.11-new/lib/libtar.h 2004-08-18 21:59:12.344855632 +0200
@@ -184,9 +184,7 @@
#define th_get_mtime(t) oct_to_int((t)->th_buf.mtime)
#define th_get_devmajor(t) oct_to_int((t)->th_buf.devmajor)
#define th_get_devminor(t) oct_to_int((t)->th_buf.devminor)
-#define th_get_linkname(t) ((t)->th_buf.gnu_longlink \
- ? (t)->th_buf.gnu_longlink \
- : (t)->th_buf.linkname)
+char *th_get_linkname(TAR *t);
char *th_get_pathname(TAR *t);
mode_t th_get_mode(TAR *t);
uid_t th_get_uid(TAR *t);