archive/tar: ensure input fits in octal field
The prior logic would over-write the NUL-terminator if the octal value was long enough. In order to prevent this, we add a fitsInOctal function that does the proper check. The relevant USTAR specification about NUL-terminator is: <<< Each numeric field is terminated by one or more <space> or NUL characters. >>> Change-Id: I6fbc6e8fe71168727eea201925d0fe08d43116ac Reviewed-on: https://go-review.googlesource.com/54432Reviewed-by: Ian Lance Taylor <iant@golang.org>
Showing
Please register or sign in to comment