mirror / busybox

BusyBox mirror
https://www.busybox.net/
Other
1.64k stars 617 forks source link

Error in hash list parsing. #42

Open Glushiator opened 3 years ago

Glushiator commented 3 years ago

https://github.com/mirror/busybox/blob/24198f652f10dca5603df7c704263358ca21f5ce/coreutils/md5_sha1_sum.c#L296 https://github.com/mirror/busybox/blob/24198f652f10dca5603df7c704263358ca21f5ce/coreutils/md5_sha1_sum.c#L299

In current form, when there is a file with two consecutive spaces in it's name and the hashlist contains binary mode markers " *" validation fails. Both markers should be searched and in case both are not NULL lower index should be selected, or instead using strstr precomputed marker positions based on hash width should be used.