postgres.git / summary / log / commit / refs

commit    0c806e75dabcac1f97bc4aca1d6bba3c58f26b6d
Author:   Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date:     Thu Nov 19 10:26:06 2026 +0000

    Fix incorrect pointer increment in pgtypes_defmt_scan()
    
    The function incorrectly increments pstr instead of *pstr when
    skipping leading spaces. This bug has remained hidden because the
    caller already skips leading spaces. There are more redundant
    leading-space skipping loops in the function and in find_end_token(),
    but I didn't try to clean those up, this commit just fixes the clear
    latent bug.
    
    Author: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
    Discussion: https://www.postgresql.org/message-id/20261119.162206.639378539262920864.horikyota.ntt@gmail.com
    Backpatch-through: 15


src/interfaces/ecpg/pgtypeslib/dt_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interfaces/ecpg/pgtypeslib/dt_common.c b/src/interfaces/ecpg/pgtypeslib/dt_common.c index c4119ab7932..97bdc104c0f 100644 --- a/src/interfaces/ecpg/pgtypeslib/dt_common.c +++ b/src/interfaces/ecpg/pgtypeslib/dt_common.c @@ -2469,7 +2469,7 @@ pgtypes_defmt_scan(union un_fmt_comb *scan_val, int scan_type, char **pstr, char char *strtol_end = NULL; while (**pstr == ' ') - pstr++; + (*pstr)++; pstr_end = find_end_token(*pstr, pfmt); if (!pstr_end) { [parent: 459595e3270d]