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 1nxXDY-0007lz-01 for pgsql-general@arkaria.postgresql.org; Sat, 04 Jun 2022 17:05:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nxXDW-0004NJ-NY for pgsql-general@arkaria.postgresql.org; Sat, 04 Jun 2022 17:05:38 +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 1nxXDW-0004NA-CN for pgsql-general@lists.postgresql.org; Sat, 04 Jun 2022 17:05:38 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nxXDU-0002gm-AJ for pgsql-general@lists.postgresql.org; Sat, 04 Jun 2022 17:05:37 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 254H5TcT574741; Sat, 4 Jun 2022 13:05:30 -0400 From: Tom Lane To: "=?ISO-8859-1?B?bWVuZ2Zhbmp1bg==?=" cc: "=?ISO-8859-1?B?cGdzcWwtZ2VuZXJhbA==?=" Subject: Re: Call pstrdup() of palloc.h will change source string, please help! In-reply-to: References: Comments: In-reply-to "=?ISO-8859-1?B?bWVuZ2Zhbmp1bg==?=" message dated "Sat, 04 Jun 2022 11:07:56 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <574739.1654362329.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 04 Jun 2022 13:05:29 -0400 Message-ID: <574740.1654362329@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "=3D?ISO-8859-1?B?bWVuZ2Zhbmp1bg=3D=3D?=3D" wri= tes: > pstrdup() will change source "system_time( stt , ett )" to "system_time(= stt " and return "system_time( stt " when it is called in = ValidateForeignTableOptions() and CStoreGetOptions(). That claim is not very credible. I'm not sure where the bug is in this code, but the chance that it's in pstrdup is frankly zero. According to the man page for strsep(), that function modifies the string pointed to by its first argument. I suspect you're failing to account for that. I'm also suspicious of the "// trim" code, which will misbehave for a zero-length token. regards, tom lane