This is an automated email from the ASF dual-hosted git repository.

reshke pushed a commit to branch REL_2_STABLE
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit 5645d474f5e33fd1fd1a356d12c43559e9615061
Author: Tom Lane <[email protected]>
AuthorDate: Mon Aug 10 06:38:35 2026 -0700

    Replace fixed-size, too-short array with a palloc'd one.
    
    MatchNamedCall's arggiven array was declared FUNC_MAX_ARGS long,
    but we may actually use up to pronallargs elements, and that can
    be more than FUNC_MAX_ARGS if the function has OUT arguments
    (cf. ProcedureCreate).  Convert it to a palloc'd array.
    
    Reported-by: Zheng Yu <[email protected]>
    Reported-by: ylwangtju <[email protected]>
    Author: Tom Lane <[email protected]>
    Reviewed-by: Michael Paquier <[email protected]>
    Reviewed-by: Masahiko Sawada <[email protected]>
    Backpatch-through: 14
    Security: CVE-2026-14679
---
 src/backend/catalog/namespace.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/backend/catalog/namespace.c b/src/backend/catalog/namespace.c
index be09847022b..24011967681 100644
--- a/src/backend/catalog/namespace.c
+++ b/src/backend/catalog/namespace.c
@@ -1378,7 +1378,7 @@ MatchNamedCall(HeapTuple proctup, int nargs, List 
*argnames,
        Oid                *p_argtypes;
        char      **p_argnames;
        char       *p_argmodes;
-       bool            arggiven[FUNC_MAX_ARGS];
+       bool       *arggiven;
        bool            isnull;
        int                     ap;                             /* call args 
position */
        int                     pp;                             /* proargs 
position */
@@ -1402,8 +1402,8 @@ MatchNamedCall(HeapTuple proctup, int nargs, List 
*argnames,
        Assert(include_out_arguments ? (pronargs == pronallargs) : (pronargs <= 
pronallargs));
 
        /* initialize state for matching */
-       *argnumbers = (int *) palloc(pronargs * sizeof(int));
-       memset(arggiven, false, pronargs * sizeof(bool));
+       *argnumbers = palloc_array(int, pronargs);
+       arggiven = palloc0_array(bool, pronallargs);
 
        /* there are numposargs positional args before the named args */
        for (ap = 0; ap < numposargs; ap++)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to