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 1jJHKE-0004Dk-PB for pgsql-bugs@arkaria.postgresql.org; Tue, 31 Mar 2020 13:53:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jJHKD-0001o4-NW for pgsql-bugs@arkaria.postgresql.org; Tue, 31 Mar 2020 13:53:05 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jJHKD-0001nt-Bp for pgsql-bugs@lists.postgresql.org; Tue, 31 Mar 2020 13:53:05 +0000 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jJHKB-0001Pq-1I for pgsql-bugs@lists.postgresql.org; Tue, 31 Mar 2020 13:53:04 +0000 Received: by mail-qk1-x743.google.com with SMTP id 139so13121924qkd.9 for ; Tue, 31 Mar 2020 06:53:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=mNkFzxuFysQSq878uUjnN065zgP+SLnpUWDKMFoZz1M=; b=rJhGwVC5KZPQo9PC7bx1lPDnTY4JaZ1Jwlv+LFeVL/asqKTVZeBafoa4pypaWhz8RR qvlmMkwr4V0Z7pjolxzxyTJNqPGfCS8bGAOmmGTx7cwXa40/xo5jf+nNRmdOzfbXMqpK o7puLej1jDy205+tlK900v05gb67aqMjZvBMFBjnyrJPCI1Rno73tzBK5tmv/5gf/yu1 IHCcrctthgiYQuVemKdMb4bzcYVqCq/oXsW9iZDrtxNW50fQSJU5hWhUxAMhr4OmLOe+ qTPNU/PwwZftje4FrmEtJro74YjRNi3nTQGKpAgCPPjvfjdHN4k6jRwuEBXK4Hqqy3f0 bfJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=mNkFzxuFysQSq878uUjnN065zgP+SLnpUWDKMFoZz1M=; b=OGWUQPmmbIoL4fYbVP5gieWHQ0x3rqV6t4mu2rWluor3Pt9CRGqHrUdlziYYFFZ7Sb uzHULpgGuLyT/+aM6STylISkj/TZUrgIa7cmUwk10Kc/Cg+5GTQBEjoEWk3wYn/ph+Vu wM3+R6c0h3WINiEkYP7qWCvfmEyt+ksqKndrailbTSzoQaxhn2VxbvJDELh6AlxaT2bf 1NQGcRweR6nxTKVFoGaG3kJE7IqZaoU5rObZqN9rW35LZf1GcQ4AXHD9Pmugtbt+2OT8 6+Urr2bFfZm2TZQ/LU9WQVeX/FAoKNBgS8XnnRJDdOyEc06dtOkM9ZyhO28ZdOXtZgem AHMQ== X-Gm-Message-State: ANhLgQ169z2BAdl09e6pV8cHrUrA9ddvoBb0svAZ9zTLMkWPkI28qm0s 6Jzna8coRKQXAhKDRmvmMq6pTg== X-Google-Smtp-Source: ADFU+vsMF2EHu2dhL++oo0NiWTUuyWeRIP4Zpx1t1cM0Kj2S4wMcu+pd9JNtH9z/kM/v7jxprhaMEg== X-Received: by 2002:a37:6ca:: with SMTP id 193mr5082667qkg.415.1585662782179; Tue, 31 Mar 2020 06:53:02 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.95.18.252]) by smtp.gmail.com with ESMTPSA id s11sm12869403qke.97.2020.03.31.06.53.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Mar 2020 06:53:01 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 5AE363009FE; Tue, 31 Mar 2020 10:52:59 -0300 (-03) Date: Tue, 31 Mar 2020 10:52:59 -0300 From: Alvaro Herrera To: Michael Paquier Cc: Tom Lane , hghwng@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16330: psql accesses null pointer in connect.c:do_connect Message-ID: <20200331135259.GA29443@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200331072153.GB1549@paquier.xyz> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Mar-31, Michael Paquier wrote: > On Mon, Mar 30, 2020 at 12:48:51PM -0300, Alvaro Herrera wrote: > > On 2020-Mar-30, Tom Lane wrote: > >> It looks to me like there's a similar hazard a bit further down > >> (line 3029): > >> > >> appendConnStrVal(&connstr, PQdb(o_conn)); > >> > >> I wonder if we should force reuse_previous to false if there's > >> no o_conn, rather than fixing this stuff piecemeal. > > > > That was my impression too. > > Good point. What do you think about the attached then? Looks better :-) -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services