LibArchive: Accept space characters as terminators of tar numeric fields

POSIX specifies that each numeric field is terminated with one or more
space or NUL characters.
This commit is contained in:
Daniel Bertalan 2022-02-23 15:04:38 +01:00 committed by Linus Groh
parent 35e5024b7d
commit a285e651f1

View file

@ -42,7 +42,7 @@ static size_t get_field_as_integral(const char (&field)[N])
{
size_t value = 0;
for (size_t i = 0; i < N; ++i) {
if (field[i] == 0)
if (field[i] == 0 || field[i] == ' ')
break;
VERIFY(field[i] >= '0' && field[i] <= '7');