postgres.git / summary / log / commit / refs
commit 35255e56d4ae41c64401b4446c4d9fc88601fde9
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 3ed5ad06c06..8c1f485f70c 100644
--- a/src/interfaces/ecpg/pgtypeslib/dt_common.c
+++ b/src/interfaces/ecpg/pgtypeslib/dt_common.c
@@ -2483,7 +2483,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: 94fb667004ba]