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

From: Silvan Jegen <s.jegen_AT_gmail.com>
Date: Tue, 14 Apr 2015 13:43:56 +0200

On Tue, Apr 14, 2015 at 12:55 PM, Gregor Best <gbe_AT_ring0.de> wrote:
> 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.

I just tested glibc's memmove. The results are:

dst == NULL, n > 0: segfault
src == NULL, n > 0: segfault

if dst or src are NULL and n is 0 there is no segfault. Fascinating.
Received on Tue Apr 14 2015 - 13:43:56 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 14 2015 - 13:48:07 CEST