Signal 11 nthe of empty file on OpenBSD 5.7
Brought to you by:
rexx
In OpenBSD 5.7 with ncurses THE-3.3RC4 using a plain userid with no .therc file, I create an empty file, edit it and nthe gives signal 11:
$touch file.test
$nthe file.test
Running gdb shows the error to occur in file.c line 762 and I have attached a patch to help correct the problem.
It appears that the code is using the phrase "chars_read - 1" to index memory when chars_read is 0. This results in a read before the start of user memory thus giving signal 11.
This seems to be caught on OpenBSD but not on Linux
After looking at this problem again, I came up with a better patch. See attachment...
This bug is fixed and can be closed.