Re: [hackers] [st] Add xmalloc and xrealloc wrappers || "Roberto E. Vargas Caballero"

From: 123 <p37sitdu_AT_lavabit.com>
Date: Thu, 13 Sep 2012 18:57:15 +0400

On Thu, Sep 13, 2012 at 04:37:51PM +0200, Joerg Zinke wrote:
> This xrealloc() is a good a example for bad c programming.

Check for zero size is not required in st. Check for NULL pointer
is not requried at all, realloc with NULL ptr is equivalent to
malloc. Only "SIZE_T_MAX / nmemb < size" check may be copied from OpenSSH.
Received on Thu Sep 13 2012 - 16:57:15 CEST

This archive was generated by hypermail 2.3.0 : Thu Sep 13 2012 - 17:00:08 CEST