Subject: | Segmentation fault on FreeBSD when no common substrings |
I get the following error on FreeBSD 5.2.1 with Ediff 0.03
bash-2.05b$ perl -MString::Ediff -e 'print String::Ediff::ediff("Aldersgate", "Bassishaw");'
Segmentation fault (core dumped)
The bug happens only when the two strings have no common substring.
I've tracked it down to a malloc which can allocate 0 bytes if there is no diff. Under FreeBSD this always returns 2048, which you can't write to. So when it writes a NULL in the first byte it crashes.
A patch is attached
Message body not shown because it is not plain text.