fpjohnston / TECO-64

Enhanced and portable version of TECO text editor in C.
24 stars 6 forks source link

Non-stop search can cause crash #13

Closed fpjohnston closed 1 year ago

fpjohnston commented 1 year ago

If the search buffer is empty (that is, there has been no previous search yet), and a user executes an N command without a text argument, TECO will crash, as shown in the following example on Linux:

teco -n -C foo.baz
*N``
Segmentation fault (core dumped)

This does not occur when using an equivalent S command. In that case, a search failure (SRH) error is issued, which is what should happen with the N command.

fpjohnston commented 1 year ago

Fixed bug in version 200.29.2. Also added new smoke test to guard against future occurrence.