From owner-svn-src-all@freebsd.org  Tue Sep 17 08:56:49 2019
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1171EFC206;
 Tue, 17 Sep 2019 08:56:49 +0000 (UTC)
 (envelope-from kostikbel@gmail.com)
Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 server-signature RSA-PSS (4096 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 46XcRh5qp9z3F6N;
 Tue, 17 Sep 2019 08:56:48 +0000 (UTC)
 (envelope-from kostikbel@gmail.com)
Received: from tom.home (kib@localhost [127.0.0.1])
 by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x8H8ufiJ095262
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Tue, 17 Sep 2019 11:56:44 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x8H8ufiJ095262
Received: (from kostik@localhost)
 by tom.home (8.15.2/8.15.2/Submit) id x8H8uf9w095261;
 Tue, 17 Sep 2019 11:56:41 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com
 using -f
Date: Tue, 17 Sep 2019 11:56:41 +0300
From: Konstantin Belousov <kostikbel@gmail.com>
To: Toomas Soome <tsoome@FreeBSD.org>
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: Re: svn commit: r352421 - head/stand/libsa
Message-ID: <20190917085641.GY2559@kib.kiev.ua>
References: <201909162028.x8GKS9jK064079@repo.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201909162028.x8GKS9jK064079@repo.freebsd.org>
User-Agent: Mutt/1.12.1 (2019-06-15)
X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM,
 NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home
X-Rspamd-Queue-Id: 46XcRh5qp9z3F6N
X-Spamd-Bar: -----
Authentication-Results: mx1.freebsd.org;
	none
X-Spamd-Result: default: False [-5.99 / 15.00];
 NEURAL_HAM_MEDIUM(-0.99)[-0.991,0];
 NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 17 Sep 2019 08:56:49 -0000

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.

> 
> Modified:
>   head/stand/libsa/zalloc_malloc.c
> 
> Modified: head/stand/libsa/zalloc_malloc.c
> ==============================================================================
> --- head/stand/libsa/zalloc_malloc.c	Mon Sep 16 20:26:53 2019	(r352420)
> +++ head/stand/libsa/zalloc_malloc.c	Mon Sep 16 20:28:08 2019	(r352421)
> @@ -55,6 +55,9 @@ Malloc(size_t bytes, const char *file, int line)
>  {
>      Guard *res;
>  
> +    if (bytes == 0)
> +	return (NULL);
> +
>  #ifdef USEENDGUARD
>      bytes += MALLOCALIGN + 1;
>  #else