Re: [dev] [st] [PATCH 4/3] tresize: remove unnecessary if

From: Gregor Best <gbe_AT_ring0.de>
Date: Tue, 14 Apr 2015 12:55:54 +0200

This commit seems to cause st to segfault on start on OpenBSD
(-current). A similar segfault has been observed in #suckless by user
mvdan, using GNU libc.

The cause seems to be that for bot `term.line` and `term.alt` are NULL
at this point. While this does mean that even with a `len` parameter of
0, the `dst` pointer gets touched, I don't think it's ever right to call
either `memcpy` or `memmove` with a NULL destination pointer.

The call to tresize that's causing the problems is the one in tnew()
immediately following the initialization of the term struct.

My suggestion would thus be to revert this commit.

-- 
	Gregor Best
--
Self Test for Paranoia:
	You know you have it when you can't think of anything that's
your own fault.
Received on Tue Apr 14 2015 - 12:55:54 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 14 2015 - 13:00:11 CEST