Re: Out-of-bounds (src/backend/utils/misc/queryjumble.c) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Out-of-bounds (src/backend/utils/misc/queryjumble.c)
Date
Msg-id 1652632.1624295959@sss.pgh.pa.us
Whole thread Raw
In response to Out-of-bounds (src/backend/utils/misc/queryjumble.c)  (Ranier Vilela <ranier.vf@gmail.com>)
List pgsql-hackers
Ranier Vilela <ranier.vf@gmail.com> writes:
> Per Coverity.
> 3 out-of-bounds at function AppendJumble.

> They have the face, smell and color of typo.
> And we usually increment the character count after a memcpy.

> Coverity no longer complained after the patch.

> Thoughts?

This patch is incorrect on its face, as you would know if you'd
spent even a couple minutes absorbing the comment in that function.

I wonder about Coverity here ... independently of whether the
hash-accumulation logic does what we want, it looks to me like
the proposed change doesn't so much remove a buffer overrun as
create one.  It would break the property jumble_len < JUMBLE_SIZE
that the subsequent lines rely on.

Please stop sending us random patches and expecting us to sort
out which ones are valid.  You're rapidly approaching the status
of "boy who cried wolf too many times".

            regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: disfavoring unparameterized nested loops
Next
From: Robert Haas
Date:
Subject: Re: disfavoring unparameterized nested loops