Re: Fix out-of-bounds in the function GetCommandTagName

2024-05-13 Thread Ranier Vilela
Em seg., 13 de mai. de 2024 às 14:38, Tom Lane escreveu: > David Rowley writes: > > I've added a CF entry under your name for this: > > https://commitfest.postgresql.org/48/4927/ > > > If it was code new to PG17 I'd be inclined to go ahead with it now, > > but it does not seem to align with

Re: Fix out-of-bounds in the function GetCommandTagName

2024-05-13 Thread Tom Lane
David Rowley writes: > I've added a CF entry under your name for this: > https://commitfest.postgresql.org/48/4927/ > If it was code new to PG17 I'd be inclined to go ahead with it now, > but it does not seem to align with making the release mode stable. > I'd bet others will feel differently

Re: Fix out-of-bounds in the function GetCommandTagName

2024-04-15 Thread Ranier Vilela
Em dom., 14 de abr. de 2024 às 23:12, David Rowley escreveu: > On Mon, 15 Apr 2024 at 12:12, Ranier Vilela wrote: > > > > Em dom., 14 de abr. de 2024 às 20:38, David Rowley > escreveu: > >> You seem to have forgotten to attach it, but my comments above were > >> written with the assumption

Re: Fix out-of-bounds in the function GetCommandTagName

2024-04-14 Thread David Rowley
On Mon, 15 Apr 2024 at 12:12, Ranier Vilela wrote: > > Em dom., 14 de abr. de 2024 às 20:38, David Rowley > escreveu: >> You seem to have forgotten to attach it, but my comments above were >> written with the assumption that the patch is what I've attached here. > > Yes, I actually forgot. > >

Re: Fix out-of-bounds in the function GetCommandTagName

2024-04-14 Thread Tom Lane
David Rowley writes: > On Mon, 15 Apr 2024 at 11:54, Tom Lane wrote: >> would this also allow us to get rid of any default: >> cases in switches on command tags? > git grep "case CMDTAG_" does not yield any results. OK. It was worth checking. regards, tom lane

Re: Fix out-of-bounds in the function GetCommandTagName

2024-04-14 Thread David Rowley
On Mon, 15 Apr 2024 at 11:54, Tom Lane wrote: > would this also allow us to get rid of any default: > cases in switches on command tags? git grep "case CMDTAG_" does not yield any results. As far as I understand, we'd only be able to get rid of a default case if we had a switch that included

Re: Fix out-of-bounds in the function GetCommandTagName

2024-04-14 Thread Ranier Vilela
Em dom., 14 de abr. de 2024 às 20:38, David Rowley escreveu: > On Mon, 15 Apr 2024 at 11:17, Ranier Vilela wrote: > > Coverity has reported some out-of-bounds bugs > > related to the GetCommandTagName function. > > > > The size of the array is defined by COMMAND_TAG_NEXTTAG enum, > > whose

Re: Fix out-of-bounds in the function GetCommandTagName

2024-04-14 Thread Tom Lane
David Rowley writes: > I think the change makes sense. I don't see any good reason to define > COMMAND_TAG_NEXTTAG or force the compiler's hand when it comes to > sizing that array. > Clearly, Coverity does not understand that we'll never call any of > those GetCommandTag* functions with

Re: Fix out-of-bounds in the function GetCommandTagName

2024-04-14 Thread David Rowley
On Mon, 15 Apr 2024 at 11:17, Ranier Vilela wrote: > Coverity has reported some out-of-bounds bugs > related to the GetCommandTagName function. > > The size of the array is defined by COMMAND_TAG_NEXTTAG enum, > whose value currently corresponds to 193. > Since enum items are evaluated starting

Fix out-of-bounds in the function GetCommandTagName

2024-04-14 Thread Ranier Vilela
Hi, Per Coverity. Coverity has reported some out-of-bounds bugs related to the GetCommandTagName function. CID 1542964: (#1 of 1): Out-of-bounds access (OVERRUN) 7. overrun-call: Overrunning callee's array of size 193 by passing argument commandtag (which evaluates to 193) in call to