[hackers] [patch] st crash inside getsel

From: <rain1_AT_openmailbox.org>
Date: Tue, 19 Apr 2016 02:48:14 +0100

Hello

I had been noticing st 0.6 terminals sometimes disappearing on openbsd.
I managed to reproduce the crash quite consistently by trying to select
and copy the output of: man ls | head -10.

Debugged the coredump and saw that linelen is always zero before the
crash - in which case I think there is an underflow in this line: last =
&term.line[y][MIN(lastx, linelen-1)]; that was resulting in memory
corruption which caused the subsequent last->mode to segment fault.

Attached is a patch that I believe fixes it.



Received on Tue Apr 19 2016 - 03:48:14 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 19 2016 - 04:02:10 CEST