Menu

#286 Signal 11 nthe of empty file on OpenBSD 5.7

4.0
closed-fixed
None
5
2024-04-13
2015-09-14
No

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

1 Attachments

Discussion

  • Richard Narron

    Richard Narron - 2018-06-15

    After looking at this problem again, I came up with a better patch. See attachment...

     
  • Richard Narron

    Richard Narron - 2024-04-07

    This bug is fixed and can be closed.

     
  • Mark Hessling

    Mark Hessling - 2024-04-13
    • status: open --> closed-fixed
    • assigned_to: Mark Hessling
    • Group: --> 4.0
     

Log in to post a comment.