diff options
author | Tim Kientzle <kientzle@gmail.com> | 2011-02-12 15:18:15 -0500 |
---|---|---|
committer | Tim Kientzle <kientzle@gmail.com> | 2011-02-12 15:18:15 -0500 |
commit | 025ba5554c3f18b342e9a04b4eeca7df0415784c (patch) | |
tree | 9114b045c9b22b735d09dee3900bcd312da554bc | |
parent | 722054f3a383686cee91e7212c3420d139b5fc33 (diff) | |
download | libarchive-025ba5554c3f18b342e9a04b4eeca7df0415784c.tar.gz |
Don't iterate past the end of an octal field on
a damaged archive.
SVN-Revision: 2972
-rw-r--r-- | contrib/untar.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/untar.c b/contrib/untar.c index dc092d32..7c34bf71 100644 --- a/contrib/untar.c +++ b/contrib/untar.c @@ -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; } |