Re: [dev] [st] [patch] multi-line selection causes core dump on OpenBSD

From: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
Date: Mon, 23 Sep 2013 10:50:32 +0200

> I'm running OpenBSD 5.3 amd64 release version with the most current st
> version from git and I noticed that st was crashing and dumping core
> when selecting multiple lines whith the cursor. This happens, because
> on line 964 of st.c (gp-1)->mode is accessed, although gp is still

Good catch. I am using also OpenBSD and I have noticied the problem
and it was in my queue ;).


> pointing at the beginning of the array term.line[y] (see line 939 for
> initialization of gp). A patch follows at the end of the mail. I
> _quickly_ tested it and it _seems_ to work, but this should be verified
> by someone else, since I don't know the st code and I only came up with
> it by inspecting the core dump.

The patch is correct, but I think there is a way easier:

- if(y < sel.ne.y && !((gp-1)->mode & ATTR_WRAP))
+ if(y < sel.ne.y && x > 0 && !((gp-1)->mode & ATTR_WRAP))

If you agree with this small difference I will commit your change.


Best regard.

-- 
Roberto E. Vargas Caballero
----------------------------
k0ga_AT_shike2.com
http://www.shike2.com
Received on Mon Sep 23 2013 - 10:50:32 CEST

This archive was generated by hypermail 2.3.0 : Mon Sep 23 2013 - 11:00:09 CEST