Fix getOctal() argument string termination to be withing array bounds.

Signed-off-by: Alexey Fomenko <[email protected]>
---
 archival/libarchive/get_header_tar.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/archival/libarchive/get_header_tar.c 
b/archival/libarchive/get_header_tar.c
index 79caff5..924547e 100644
--- a/archival/libarchive/get_header_tar.c
+++ b/archival/libarchive/get_header_tar.c
@@ -55,7 +55,7 @@ static unsigned long long getOctal(char *str, int len)
        /* NB: leading spaces are allowed. Using strtoull to handle that.
         * The downside is that we accept e.g. "-123" too :(
         */
-       str[len] = '\0';
+       str[len-1] = '\0';
        v = strtoull(str, &end, 8);
        /* std: "Each numeric field is terminated by one or more
         * <space> or NUL characters". We must support ' '! */
-- 
1.7.2.5

_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to