]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Don't iterate past the end of an octal field on
authorTim Kientzle <kientzle@gmail.com>
Sat, 12 Feb 2011 20:18:15 +0000 (15:18 -0500)
committerTim Kientzle <kientzle@gmail.com>
Sat, 12 Feb 2011 20:18:15 +0000 (15:18 -0500)
a damaged archive.

SVN-Revision: 2972

contrib/untar.c

index dc092d325e0276c5d797ff38e3835d3f383cfbf1..7c34bf7110a710346d349b8d271e457f3f10b5d6 100644 (file)
@@ -38,7 +38,7 @@ parseoct(const char *p, size_t n)
 {
        int i = 0;
 
-       while (*p < '0' || *p > '7') {
+       while ((*p < '0' || *p > '7') && n > 0) {
                ++p;
                --n;
        }