summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorTim Kientzle <kientzle@gmail.com>2011-02-12 15:18:15 -0500
committerTim Kientzle <kientzle@gmail.com>2011-02-12 15:18:15 -0500
commit025ba5554c3f18b342e9a04b4eeca7df0415784c (patch)
tree9114b045c9b22b735d09dee3900bcd312da554bc /contrib
parent722054f3a383686cee91e7212c3420d139b5fc33 (diff)
downloadlibarchive-025ba5554c3f18b342e9a04b4eeca7df0415784c.tar.gz
Don't iterate past the end of an octal field on
a damaged archive. SVN-Revision: 2972
Diffstat (limited to 'contrib')
-rw-r--r--contrib/untar.c2
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;
}