mirror of
https://git.savannah.gnu.org/git/tar.git
synced 2026-07-21 15:32:42 +00:00
05805868f2
carefully. Do not pass arbitrary char values to isspace, as this has undefined behavior. Likewise for assigning arbitrary uintmax_t values to other types. (read_negative_num, read_unsigned_num, read_timespec): New functions, to check input values a bit more carefuly. (read_num): Use read_unsigned_num. New arg MAX_VAL; all callers changed. (read_incr_db_2): Use these new functions. Use a consistent diagnostic for unexpected EOF. (read_directory_file): Do not assign arbitrary uintmax_t value to int. (read_timespec, write_directory_file_entry, write_directory_file): Handle negative time_t values correctly. We don't bother to do this with pre-2 formats, since presumably the time stamps were output incorrectly.