Date: Tue, 17 Sep 2019 12:05:26 +0300 From: Toomas Soome <tsoome@me.com> To: Konstantin Belousov <kostikbel@gmail.com> Cc: Toomas Soome <tsoome@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r352421 - head/stand/libsa Message-ID: <6762A429-F17F-46D1-A55B-BD9C627D6903@me.com> In-Reply-To: <20190917085641.GY2559@kib.kiev.ua> References: <201909162028.x8GKS9jK064079@repo.freebsd.org> <20190917085641.GY2559@kib.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
> On 17 Sep 2019, at 11:56, Konstantin Belousov <kostikbel@gmail.com> wrote: > > On Mon, Sep 16, 2019 at 08:28:09PM +0000, Toomas Soome wrote: >> Author: tsoome >> Date: Mon Sep 16 20:28:08 2019 >> New Revision: 352421 >> URL: https://svnweb.freebsd.org/changeset/base/352421 >> >> Log: >> loader: Malloc(0) should return NULL. >> >> We really should not allocate anything with size 0. > Why ? This is quite unexpected from other environments, where > malloc(0) returns unique object. > Hiding bugs. And, we are not getting unique object, we are getting chunk of memory with payload length of 0 and the memory content depends on if head and tail guards are used - the chunk is with size at least MALLOCALIGN (16 or 64 bytes) and the chunk is from random location of heap. rgds, toomas
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6762A429-F17F-46D1-A55B-BD9C627D6903>
