Re: pg17.3 PQescapeIdentifier() ignores len

2025-02-15 Thread Christoph Berg
Re: Andres Freund > I think that'd be *really* helpful. Of course that does require somebody > watching and raising an alarm... > > Do you have ongoing package builds for sid or such? What I am doing anyway is to trigger the regression test of each package once a month (randomly distributed over

Re: pg17.3 PQescapeIdentifier() ignores len

2025-02-15 Thread Andres Freund
Hi, On 2025-02-15 17:55:12 +0100, Christoph Berg wrote: > Re: Andres Freund > > I don't think that common uses of PQescapeIdentifier/Literal are likely to > > catch the problem, so it's perhaps not too surprising it wasn't caught. > > Which, > > I guess, shows that we really need more explicit ed

Re: pg17.3 PQescapeIdentifier() ignores len

2025-02-15 Thread Christoph Berg
Re: Andres Freund > > What's missing in the PG regression tests to see that problem? > > Well, the expanded tests added as part of the fix would catch it, but I agree, > it's a problem this wasn't caught beforehand. Oh sorry, I was actually skimming the git log to see if there is a test, but then

Re: pg17.3 PQescapeIdentifier() ignores len

2025-02-15 Thread Andres Freund
Hi, On 2025-02-15 13:33:54 +0100, Christoph Berg wrote: > Re: Andres Freund > > > > The fprintf suggests that since 5dc1e42b4 PQescapeIdentifier ignores > > > > its len. > > > > > > Ugh, yes. Need something like the attached. > > > > I just pushed this fix, together with an expansion of test_e

Re: pg17.3 PQescapeIdentifier() ignores len

2025-02-15 Thread Christoph Berg
Re: Andres Freund > > > The fprintf suggests that since 5dc1e42b4 PQescapeIdentifier ignores its > > > len. > > > > Ugh, yes. Need something like the attached. > > I just pushed this fix, together with an expansion of test_escape.c. With the > expanded test both uses of strlen() are detected.

Re: pg17.3 PQescapeIdentifier() ignores len

2025-02-14 Thread Andres Freund
Hi, On 2025-02-13 14:00:09 -0500, Tom Lane wrote: > Justin Pryzby writes: > > The fprintf suggests that since 5dc1e42b4 PQescapeIdentifier ignores its > > len. > > Ugh, yes. Need something like the attached. I just pushed this fix, together with an expansion of test_escape.c. With the expande

Re: pg17.3 PQescapeIdentifier() ignores len

2025-02-14 Thread Ranier Vilela
Em qui., 13 de fev. de 2025 às 16:00, Tom Lane escreveu: > Justin Pryzby writes: > > The fprintf suggests that since 5dc1e42b4 PQescapeIdentifier ignores its > len. > > Ugh, yes. Need something like the attached. > > FTR, 5dc1e42b4 et al were quite subtle patches done under extreme time > press

Re: pg17.3 PQescapeIdentifier() ignores len

2025-02-13 Thread Nathan Bossart
On Thu, Feb 13, 2025 at 02:00:09PM -0500, Tom Lane wrote: > Justin Pryzby writes: >> The fprintf suggests that since 5dc1e42b4 PQescapeIdentifier ignores its len. > > Ugh, yes. Need something like the attached. Your patch looks right to me. -- nathan

Re: pg17.3 PQescapeIdentifier() ignores len

2025-02-13 Thread Ranier Vilela
Em qui., 13 de fev. de 2025 às 16:05, Tom Lane escreveu: > Ranier Vilela writes: > > Interesting, Coverity has some new reports regarding PQescapeIdentifier. > > > CID 1591290: (#1 of 1): Out-of-bounds access (OVERRUN) > > 2. alloc_strlen: Allocating insufficient memory for the terminating null

Re: pg17.3 PQescapeIdentifier() ignores len

2025-02-13 Thread Tom Lane
Ranier Vilela writes: > Interesting, Coverity has some new reports regarding PQescapeIdentifier. > CID 1591290: (#1 of 1): Out-of-bounds access (OVERRUN) > 2. alloc_strlen: Allocating insufficient memory for the terminating null of > the string. [Note: The source code implementation of the functi

Re: pg17.3 PQescapeIdentifier() ignores len

2025-02-13 Thread Tom Lane
Justin Pryzby writes: > The fprintf suggests that since 5dc1e42b4 PQescapeIdentifier ignores its len. Ugh, yes. Need something like the attached. FTR, 5dc1e42b4 et al were quite subtle patches done under extreme time pressure. I wonder if they have any other issues. More eyes on those patches

Re: pg17.3 PQescapeIdentifier() ignores len

2025-02-13 Thread Ranier Vilela
Em qui., 13 de fev. de 2025 às 13:51, Justin Pryzby escreveu: > I found errors in our sql log after upgrading to 17.3. > > error_severity | ERROR > message| schema > "rptcache.44e3955c33bb79f55750897da0c5ab1fa2004af1_20250214" does not exist > query | copy > "rptcache.44e3955c33b