Fix OOB read in contrib/untar.c parseoct()
Reported-by: ZUENS2020
This commit is contained in:
1 parent
78b632c336
commit
0064032972
1 file changed
+2
-2
+2
-2
@@ -60,11 +60,11 @@ parseoct(const char *p, size_t n)
|
||||
{
|
||||
unsigned long i = 0;
|
||||
|
||||
while ((*p < '0' || *p > '7') && n > 0) {
|
||||
while (n > 0 && (*p < '0' || *p > '7')) {
|
||||
++p;
|
||||
--n;
|
||||
}
|
||||
while (*p >= '0' && *p <= '7' && n > 0) {
|
||||
while (n > 0 && *p >= '0' && *p <= '7') {
|
||||
i *= 8;
|
||||
i += *p - '0';
|
||||
++p;
|
||||
|
||||
Reference in new issue
Block a user