wok-current diff busybox/stuff/busybox-1.10.1-header_tar.u @ rev 1494

Up gnutls (2.4.2w)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Oct 05 13:04:15 2008 +0000 (2008-10-05)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/busybox/stuff/busybox-1.10.1-header_tar.u	Sun Oct 05 13:04:15 2008 +0000
     1.3 @@ -0,0 +1,24 @@
     1.4 +--- busybox-1.10.1/archival/libunarchive/get_header_tar.c
     1.5 ++++ busybox-1.10.1/archival/libunarchive/get_header_tar.c
     1.6 +@@ -24,18 +24,20 @@
     1.7 + };
     1.8 + #endif
     1.9 + 
    1.10 +-/* NB: _DESTROYS_ str[len] character! */
    1.11 + static unsigned long long getOctal(char *str, int len)
    1.12 + {
    1.13 + 	unsigned long long v;
    1.14 ++	char last;
    1.15 + 	/* Actually, tar header allows leading spaces also.
    1.16 + 	 * Oh well, we will be liberal and skip this...
    1.17 + 	 * The only downside probably is that we allow "-123" too :)
    1.18 + 	if (*str < '0' || *str > '7')
    1.19 + 		bb_error_msg_and_die("corrupted octal value in tar header");
    1.20 + 	*/
    1.21 ++	last = str[len];
    1.22 + 	str[len] = '\0';
    1.23 + 	v = strtoull(str, &str, 8);
    1.24 ++	str[len] = last;
    1.25 + 	if (*str && (!ENABLE_FEATURE_TAR_OLDGNU_COMPATIBILITY || *str != ' '))
    1.26 + 		bb_error_msg_and_die("corrupted octal value in tar header");
    1.27 + 	return v;