Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iN6WU-0006nu-Rd for pgsql-committers@arkaria.postgresql.org; Wed, 23 Oct 2019 02:37:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iN6WT-0005FP-JR for pgsql-committers@arkaria.postgresql.org; Wed, 23 Oct 2019 02:37:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iN6WS-0005FF-7h for pgsql-committers@lists.postgresql.org; Wed, 23 Oct 2019 02:37:17 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iN6WO-0006Du-Dn for pgsql-committers@lists.postgresql.org; Wed, 23 Oct 2019 02:37:15 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id B74A720CA5; Tue, 22 Oct 2019 22:37:09 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 22 Oct 2019 22:37:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=Dq2UsRWRpaQAmePHZwC7fpSr4Nn 6KIKhVJ5G06Rwi40=; b=mkcBnIRjxPqF5inVHSaDCQrS7plTeHZPX6mAor8LUgf zD+XQrQvStFVxBI0OmnwzURz8yxadquo3r2CKp/0Nvbidoo1edu6fR0sh1J106om ErdI2rsY0om34hEOc50PRYh8o/AmXhczun6dp0V+tZJVmCpG3AfP2dUfSJ+/vmGY r1P/v5d7qySU9v/WGOTpVnln3jUajwCjOxNW9wrtWa5kzywqqk7SJ6i/lZTp+pFC YP44ivq/ArD4yeacBUDKBB8DW1HOkUM/uhWgIpzF+EJIPzHOp5pQ1vokGAeKgUG6 yIeJhoiP0ZTg5YR9FLOODDfehgf/jahwGABwL7VlCDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=fm1; bh=Dq2UsR WRpaQAmePHZwC7fpSr4Nn6KIKhVJ5G06Rwi40=; b=jCccQKUUoQU6hwabYQqbHz MPf1Ycfj8Rkp83Y54eb9knJlukxda6NwlwvF7jmxAN6juYg5u4kKgDryAY6Ro0Y6 F4nAdMck20XyKqJTL3hzM8tHZm4Md+/1NuUr6Y8YKeMBz/XYZjKU4559C705jWVU gaivK8SqfEn55zVowXUipMclzAPFERJyMvt1frW1JuMo3r3ysP3EpwcLil4ZFZA/ jQURPbQD/b0UvgMUQ4wjYSQ6W5pwGCnXvkY83S64CuwZU5uUT8GLBHarhHuuZeeK ieXAe8BnAx5F+fkaqPR5LKeaOwJ6BD4JGS7zwDre65UNl8GLDK/YK7Rf1WUMFh8g == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrkeekgdehlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecukfhppeduudekrddvgedurddvgeelrdefudenucfrrghrrghm pehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiienucevlhhush htvghrufhiiigvpedt X-ME-Proxy: Received: from paquier.xyz (mp76f1f91f.ap.nuro.jp [118.241.249.31]) by mail.messagingengine.com (Postfix) with ESMTPA id 16690D60062; Tue, 22 Oct 2019 22:37:07 -0400 (EDT) Date: Wed, 23 Oct 2019 11:37:05 +0900 From: Michael Paquier To: Peter Eisentraut Cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Fix parsing of integer values for connection parameters in libpq Message-ID: <20191023023652.GB3286@paquier.xyz> References: <20191022100553.GA3908@paquier.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="bi5JUZtvcfApsciF" Content-Disposition: inline In-Reply-To: <20191022100553.GA3908@paquier.xyz> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --bi5JUZtvcfApsciF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 22, 2019 at 07:05:53PM +0900, Michael Paquier wrote: > Yes, it looks like a brain fade here. Conversion failures are tracked > before that, so strtol() would not return NULL for endptr. The first > part could just be removed as per the attached.=20 I looked at that with a fresher mind, and fixed it, with an extra assertion making sure that we never call it with a NULL input. All callers of parse_int_param are careful to not call the routine with a NULL input, but future callers may not be that careful... -- Michael --bi5JUZtvcfApsciF Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl2vvNEACgkQnvQgOdby QH2ylw/9ECGvRVwLms+2WbsOw2YKlcfYOKOjThtCX0Kze3ZdgE0ivLTuFWAie8t8 eIGKPGVh7dgIwW7O8UbZTGw8Y65eH2E3hdGU3B2ShcqDWGoeWCQG+NdboJBj2eUP iAcDo1G9WK92sTN+4izBdm+Kk1RPF9qHN5usA5Vo+ROKMY9B5mbfJ5SzXkXxeJlg aVHkMbCg6kCdnz17gb9WdADuR5XhJYUvvGXvt2+KWXTPPqGddkFFVY+Nid+b/Ww6 dY2vvAvULUwm8KbZ7h6WDVbni8MVUwkR3YaYZpNmJiBALQnTcA99pwpXcH+yHy4q ktS+nrKQTWD5peKrqgs8kBuO7oK3GzWiu3SplkgjNA2ScYFwzIuoittB5zzZ2Y3C 9fS45hG0NS+jOoQ9jnkeGv0phuEDRj5x+1PeshoH1VaVeUQ1tqJZDn5MNdKywBez NOCcRjhXBlM4fHmk7gZPRskYfy3PCGSXOHiS7hT2APIaDG1xIqdktZO+757sbekJ PdQiOLSR8yEM/249hVsHF1cyaTmyY1wdegOR3hu8Gt+t154VH9TsZm09UoPlU+3w rL2pz1kn8i5V9in/Z+YKS2MIKdVonz/t1xn2Gb/hJ2j4Ts6K/m8MBQfYsb/a6qAS OV4EH6YJm5+8ZBegjljsFcTkB08ExNOYgLc74DLq6AW/eW9pmVA= =yXhq -----END PGP SIGNATURE----- --bi5JUZtvcfApsciF--