mirror of
https://github.com/uutils/coreutils.git
synced 2026-05-06 15:49:31 -04:00
0366d3c657
* cksum: fix parsing error with tagged cheksum files When passed the '-c'/'--check' flag, and parsing a checksum file in the "tagged" format, cksum (symlinked to sha256sum, etc...) expects a line that looks like this: ShA256 (file.bin) = da39a3ee5e6b4b0d3255bfef95601890afd80709 If the hash algorithm at the beginning of the line (in the above case SHA256) is missing, then cksum panics because it is attempts to use the value of an array at index -1. This fix causes cksum to instead consider the line a syntax error and ignore it, just as GNU cksum does. I also added unit and integration tests to check for the above behaviour. --------- Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>