Re: Call pstrdup() of palloc.h will change source string, please help! - Mailing list pgsql-general

From Tom Lane
Subject Re: Call pstrdup() of palloc.h will change source string, please help!
Date
Msg-id 574740.1654362329@sss.pgh.pa.us
Whole thread Raw
In response to Call pstrdup() of palloc.h will change source string, please help!  ("mengfanjun" <meng_fan_jun@foxmail.com>)
List pgsql-general
"=?ISO-8859-1?B?bWVuZ2Zhbmp1bg==?=" <meng_fan_jun@foxmail.com> writes:
> pstrdup() will change source "system_time( stt , ett )" to "system_time( stt " and return "system_time( stt
" whenit 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



pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Window function?
Next
From: John W Higgins
Date:
Subject: Re: Window function?