-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
read_standard_header: improve error checks & messages
This is a fairly significant refactoring of the error checking aspect of header parsing with a few high-level improvements. The first major improvement is that this now extracts and checks the version string first, then the checksum and only if those are valid does it try extracting any other fields. This makes the error message a bit clearer: previously you would get a cryptic complaint about an invalid octal digit if you tried to parse something that wasn't a tar file, now at least you get an "invalid version string for tar file" error. This now also dumps the entire header data if there is any error parsing the header, which helps with diagnosis. In addition, the error checking and reporting for boundary conditions in fields which can be malformed (i.e. octal integers) is much improved. Last but not least, the test coverage of all of this is much increased.
- Loading branch information
1 parent
0910203
commit 71ce072
Showing
4 changed files
with
264 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.