Subversion Repositories libtar

Compare Revisions

Ignore whitespace Rev 30 → Rev 31

/trunk/debian/changelog
6,8 → 6,11
encountering longer filenames later. Second, two variables were mixed
up in tar_append_tree(). Also, fix a potential memory leak and trim
the patch a bit.
* [SECURITY] CVE-2013-4420.patch: When the prefix field is in use, the
safer_name_suffix() function should certainly be applied to the
combination of it and the name field, not just on the name field.
 
-- Magnus Holmgren <holmgren@debian.org> Sat, 15 Feb 2014 21:54:56 +0100
-- Magnus Holmgren <holmgren@debian.org> Sat, 15 Feb 2014 23:21:56 +0100
 
libtar (1.2.20-2) unstable; urgency=low
 
/trunk/debian/patches/CVE-2013-4420.patch
48,23 → 48,17
- return t->th_buf.gnu_longname;
+ return safer_name_suffix(t->th_buf.gnu_longname);
size_t pathlen =
strlen(t->th_buf.prefix) + strlen(t->th_buf.name) + 2;
@@ -43,12 +72,12 @@ th_get_pathname(TAR *t)
if (t->th_buf.prefix[0] == '\0')
{
- snprintf(t->th_pathname, pathlen, "%.100s", t->th_buf.name);
+ snprintf(t->th_pathname, pathlen, "%.100s", safer_name_suffix(t->th_buf.name));
/* allocate the th_pathname buffer if not already */
if (t->th_pathname == NULL)
@@ -50,7 +79,7 @@ th_get_pathname(TAR *t)
}
else
{
snprintf(t->th_pathname, pathlen, "%.155s/%.100s",
- t->th_buf.prefix, t->th_buf.name);
+ t->th_buf.prefix, safer_name_suffix(t->th_buf.name));
}
/* will be deallocated in tar_close() */
- return t->th_pathname;
+ return safer_name_suffix(t->th_pathname);
}
--- a/lib/extract.c
+++ b/lib/extract.c
@@ -298,14 +298,14 @@ tar_extract_hardlink(TAR * t, char *real
103,3 → 97,17
#endif
+char* safer_name_suffix(char const*);
--- a/lib/output.c
+++ b/lib/output.c
@@ -123,9 +123,9 @@ th_print_long_ls(TAR *t)
else
printf(" link to ");
if ((t->options & TAR_GNU) && t->th_buf.gnu_longlink != NULL)
- printf("%s", t->th_buf.gnu_longlink);
+ printf("%s", safer_name_suffix(t->th_buf.gnu_longlink));
else
- printf("%.100s", t->th_buf.linkname);
+ printf("%.100s", safer_name_suffix(t->th_buf.linkname));
}
putchar('\n');