# HG changeset patch # User Pascal Bellard # Date 1210195097 0 # Node ID 9c508a04c78d6a0186bc57fa018a11d55d24b54b # Parent fab97211d72f83b729f34255dd1fc58e21081d33 busybox: do not break prefix diff -r fab97211d72f -r 9c508a04c78d busybox/receipt --- a/busybox/receipt Wed May 07 01:14:00 2008 +0200 +++ b/busybox/receipt Wed May 07 21:18:17 2008 +0000 @@ -28,6 +28,7 @@ $PACKAGE-$VERSION-tftp.u $PACKAGE-$VERSION-tar.u $PACKAGE-$VERSION-script.u +$PACKAGE-$VERSION-header_tar.u EOT cp ../stuff/$PACKAGE-$VERSION.config .config make oldconfig diff -r fab97211d72f -r 9c508a04c78d busybox/stuff/busybox-1.10.1-header_tar.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/busybox/stuff/busybox-1.10.1-header_tar.u Wed May 07 21:18:17 2008 +0000 @@ -0,0 +1,24 @@ +--- busybox-1.10.1/archival/libunarchive/get_header_tar.c ++++ busybox-1.10.1/archival/libunarchive/get_header_tar.c +@@ -24,18 +24,20 @@ + }; + #endif + +-/* NB: _DESTROYS_ str[len] character! */ + static unsigned long long getOctal(char *str, int len) + { + unsigned long long v; ++ char last; + /* Actually, tar header allows leading spaces also. + * Oh well, we will be liberal and skip this... + * The only downside probably is that we allow "-123" too :) + if (*str < '0' || *str > '7') + bb_error_msg_and_die("corrupted octal value in tar header"); + */ ++ last = str[len]; + str[len] = '\0'; + v = strtoull(str, &str, 8); ++ str[len] = last; + if (*str && (!ENABLE_FEATURE_TAR_OLDGNU_COMPATIBILITY || *str != ' ')) + bb_error_msg_and_die("corrupted octal value in tar header"); + return v;