pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: psql: Fix out-of-bounds reads in prompt expansion
6+ messages / 1 participants
[nested] [flat]

* pgsql: psql: Fix out-of-bounds reads in prompt expansion
@ 2026-11-20 06:15  Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Fujii Masao @ 2026-11-20 06:15 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

psql: Fix out-of-bounds reads in prompt expansion

psql could crash when a custom prompt contained a %:name: or
%`command` escape without its closing delimiter.

This happened because prompt expansion assumed that the closing
delimiter was present and read past the end of the prompt string
when it was missing.

Fix this by checking for the closing delimiter before advancing
past it.

Backpatch to all supported versions.

Author: Chao Li <lic@highgo.com>
Reviewed-by: Kirill Reshke <reshkekirill@gmail.com>
Reviewed-by: Ishjaap Singh <ishjaap.singh07@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/0B33F84F-6AA3-4A39-A45D-D8F31D4E44D8@gmail.com
Backpatch-through: 15

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f772e165b87b2a4c9b13aec3b6795d6215147147

Modified Files
--------------
src/bin/psql/prompt.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: psql: Fix out-of-bounds reads in prompt expansion
@ 2026-11-20 06:15  Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Fujii Masao @ 2026-11-20 06:15 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

psql: Fix out-of-bounds reads in prompt expansion

psql could crash when a custom prompt contained a %:name: or
%`command` escape without its closing delimiter.

This happened because prompt expansion assumed that the closing
delimiter was present and read past the end of the prompt string
when it was missing.

Fix this by checking for the closing delimiter before advancing
past it.

Backpatch to all supported versions.

Author: Chao Li <lic@highgo.com>
Reviewed-by: Kirill Reshke <reshkekirill@gmail.com>
Reviewed-by: Ishjaap Singh <ishjaap.singh07@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/0B33F84F-6AA3-4A39-A45D-D8F31D4E44D8@gmail.com
Backpatch-through: 15

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e7e1835e6b026589c8d0650dda4cd1ec8e0e29ea

Modified Files
--------------
src/bin/psql/prompt.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: psql: Fix out-of-bounds reads in prompt expansion
@ 2026-11-20 06:15  Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Fujii Masao @ 2026-11-20 06:15 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

psql: Fix out-of-bounds reads in prompt expansion

psql could crash when a custom prompt contained a %:name: or
%`command` escape without its closing delimiter.

This happened because prompt expansion assumed that the closing
delimiter was present and read past the end of the prompt string
when it was missing.

Fix this by checking for the closing delimiter before advancing
past it.

Backpatch to all supported versions.

Author: Chao Li <lic@highgo.com>
Reviewed-by: Kirill Reshke <reshkekirill@gmail.com>
Reviewed-by: Ishjaap Singh <ishjaap.singh07@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/0B33F84F-6AA3-4A39-A45D-D8F31D4E44D8@gmail.com
Backpatch-through: 15

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/658a1cabed3f65c3e3cd3688454faea709d5ab2b

Modified Files
--------------
src/bin/psql/prompt.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: psql: Fix out-of-bounds reads in prompt expansion
@ 2026-11-20 06:15  Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Fujii Masao @ 2026-11-20 06:15 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

psql: Fix out-of-bounds reads in prompt expansion

psql could crash when a custom prompt contained a %:name: or
%`command` escape without its closing delimiter.

This happened because prompt expansion assumed that the closing
delimiter was present and read past the end of the prompt string
when it was missing.

Fix this by checking for the closing delimiter before advancing
past it.

Backpatch to all supported versions.

Author: Chao Li <lic@highgo.com>
Reviewed-by: Kirill Reshke <reshkekirill@gmail.com>
Reviewed-by: Ishjaap Singh <ishjaap.singh07@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/0B33F84F-6AA3-4A39-A45D-D8F31D4E44D8@gmail.com
Backpatch-through: 15

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f01e00f0021673ed29044342320aee65a4132ec7

Modified Files
--------------
src/bin/psql/prompt.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: psql: Fix out-of-bounds reads in prompt expansion
@ 2026-11-20 06:15  Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Fujii Masao @ 2026-11-20 06:15 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

psql: Fix out-of-bounds reads in prompt expansion

psql could crash when a custom prompt contained a %:name: or
%`command` escape without its closing delimiter.

This happened because prompt expansion assumed that the closing
delimiter was present and read past the end of the prompt string
when it was missing.

Fix this by checking for the closing delimiter before advancing
past it.

Backpatch to all supported versions.

Author: Chao Li <lic@highgo.com>
Reviewed-by: Kirill Reshke <reshkekirill@gmail.com>
Reviewed-by: Ishjaap Singh <ishjaap.singh07@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/0B33F84F-6AA3-4A39-A45D-D8F31D4E44D8@gmail.com
Backpatch-through: 15

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/c3202b09889d67123a7da163e7ba54eaaf50283a

Modified Files
--------------
src/bin/psql/prompt.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: psql: Fix out-of-bounds reads in prompt expansion
@ 2026-11-20 06:15  Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Fujii Masao @ 2026-11-20 06:15 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

psql: Fix out-of-bounds reads in prompt expansion

psql could crash when a custom prompt contained a %:name: or
%`command` escape without its closing delimiter.

This happened because prompt expansion assumed that the closing
delimiter was present and read past the end of the prompt string
when it was missing.

Fix this by checking for the closing delimiter before advancing
past it.

Backpatch to all supported versions.

Author: Chao Li <lic@highgo.com>
Reviewed-by: Kirill Reshke <reshkekirill@gmail.com>
Reviewed-by: Ishjaap Singh <ishjaap.singh07@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/0B33F84F-6AA3-4A39-A45D-D8F31D4E44D8@gmail.com
Backpatch-through: 15

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/69d0abc4f950082609458e5973a92b8aa1e8ffaa

Modified Files
--------------
src/bin/psql/prompt.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2026-11-20 06:15 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-11-20 06:15 pgsql: psql: Fix out-of-bounds reads in prompt expansion Fujii Masao <fujii@postgresql.org>
2026-11-20 06:15 pgsql: psql: Fix out-of-bounds reads in prompt expansion Fujii Masao <fujii@postgresql.org>
2026-11-20 06:15 pgsql: psql: Fix out-of-bounds reads in prompt expansion Fujii Masao <fujii@postgresql.org>
2026-11-20 06:15 pgsql: psql: Fix out-of-bounds reads in prompt expansion Fujii Masao <fujii@postgresql.org>
2026-11-20 06:15 pgsql: psql: Fix out-of-bounds reads in prompt expansion Fujii Masao <fujii@postgresql.org>
2026-11-20 06:15 pgsql: psql: Fix out-of-bounds reads in prompt expansion Fujii Masao <fujii@postgresql.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox