md5sum, sha1sum, etc: handle invalid input (i.e., don't segfault)
authorJim Meyering <meyering@redhat.com>
Tue, 15 Apr 2008 06:19:11 +0000 (08:19 +0200)
committerJim Meyering <meyering@redhat.com>
Tue, 15 Apr 2008 06:46:48 +0000 (08:46 +0200)
commit7cb24684cc4ef96bb25dfc1c819acfc3b98d9442
treeb0d71c4140509c1906993d06e5c1497fa04a13d8
parent739cf4e8325775dd6400984b3b52e67b3102e556
md5sum, sha1sum, etc: handle invalid input (i.e., don't segfault)

* src/md5sum.c (bsd_split_3): Return right away if s_len == 0.
* tests/misc/md5sum (bsd-segv): New test for the above.
* tests/misc/sha1sum (bsd-segv): Likewise.
* NEWS: Mention the bug fix.
Reported by Cristian Cadar, Daniel Dunbar and Dawson Engler.
NEWS
src/md5sum.c
tests/misc/md5sum
tests/misc/sha1sum