Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m6S4a-0002BK-0R for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Jul 2021 06:20:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m6S4Y-0003E0-Mf for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Jul 2021 06:20:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m6S4Y-0003Ds-Eh for pgsql-hackers@lists.postgresql.org; Thu, 22 Jul 2021 06:20:42 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m6S4T-00011N-8U for pgsql-hackers@lists.postgresql.org; Thu, 22 Jul 2021 06:20:41 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id DEB603200926; Thu, 22 Jul 2021 02:20:33 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 22 Jul 2021 02:20:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=Y7gsmaWrahm01Gg9yrpJmyH6ZYb14IPCipxdiwVfM Bk=; b=UHm18itM3uYvY+tPZPBLLvMk/752zD5MQXzvepR4s9QsKJE3w8dPdCDcR rpR3SKEG+GOKWThYganj0oYaVtffNYCKe5RxrQWmG3h8BO/VWSccyrvA8zPErhDR +/DsfYlPx0Fi2RlLEQ7MyzujBjEgzpMwSVBMU+NY+ANUbqYX33+VS6H8IFGQANbR IKS3P+zGfRRZOqcMGl2Xb/fPWk5Vbz+i4Ys5HVuKVXeaKinztadC8MrLJaM5ezAj Un2TLFANOUctB+Ed6zbJhv+z8jlZlaUFwuhV6FGfOAHztIHx2bv/kVyfZVKY4KDA 8njywYEfA4G4tfWBJL240yUxFZ3Vg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrfeehgddutdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomheprfgvthgv rhcugfhishgvnhhtrhgruhhtuceophgvthgvrhdrvghishgvnhhtrhgruhhtsegvnhhtvg hrphhrihhsvggusgdrtghomheqnecuggftrfgrthhtvghrnhepkeetfeevtdduffehvdel jeelleevleekhfelhedviefhjeehjedtjeelgeefueeinecuffhomhgrihhnpehmuhhslh dqlhhisggtrdhorhhgpdhgihhthhhusgdrtghomhenucevlhhushhtvghrufhiiigvpedt necurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrrdgvihhsvghnthhrrghuthesvg hnthgvrhhprhhishgvuggsrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 22 Jul 2021 02:20:31 -0400 (EDT) Subject: Re: printf %s with NULL pointer (was Re: BUG #17098: Assert failed on composing an error message when adding a type to an extension being dropped) To: Tom Lane Cc: Ranier Vilela , Laurenz Albe , PostgreSQL Hackers References: <17098-b960f3616c861f83@postgresql.org> <2468663.1626017338@sss.pgh.pa.us> <2984422.1626110456@sss.pgh.pa.us> <3227956.1626186568@sss.pgh.pa.us> <3280448.1626200778@sss.pgh.pa.us> <06a9ff0f-d1e9-0340-2f3b-180cefe41c7a@enterprisedb.com> <3517180.1626280000@sss.pgh.pa.us> From: Peter Eisentraut Message-ID: <768db26c-cf9a-6943-38b1-2d5ac8cc86f2@enterprisedb.com> Date: Thu, 22 Jul 2021 08:20:28 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <3517180.1626280000@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 14.07.21 18:26, Tom Lane wrote: > Peter Eisentraut writes: >> In this particular case, I would for example be quite curious how those >> alternative minimal C libraries such as musl-libc handle this. > > Interesting question, so I took a look: > > https://git.musl-libc.org/cgit/musl/tree/src/stdio/vfprintf.c#n593 > > case 's': > a = arg.p ? arg.p : "(null)"; > ... > > Any others you'd like to consider? Similar here: https://github.com/ensc/dietlibc/blob/master/lib/__v_printf.c#L188 I think unless we get counterexamples, this is all good.