segsegv due lack of NULL-termination opt.files
Brought to you by:
aleksey14
rhash-1.2.7 dies on sigsegv (depending on previous memory content and malloc implementation) due lack of explicit NULL-termination of opt.files array.
BTW, for whatever reason (it checks only output and not $?) test/test_rhash fails to catch this.
Thanks for catching, but this bug is duplicate of
#3391587 Segmentation fault running tests
https://sourceforge.net/tracker/?func=detail&aid=3391587&group_id=205103&atid=992288
The attached patch is alternative (but simple) solution to patch from #3391587. Looks like the code is correct, without a buffer overflow.
A agree that $? should be checked, But RHash returns different ExitCodes, not sure if it can be separated from a program crash.
the bug was fixed in v1.2.8