pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: psql: Fix psql slash option leaks
7+ messages / 1 participants
[nested] [flat]

* pgsql: psql: Fix psql slash option leaks
@ 2026-08-19 03:39 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Fujii Masao @ 2026-08-19 03:39 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

psql: Fix psql slash option leaks

psql_scan_slash_option() returns a malloc'd string, but \getresults,
\gset in pipeline mode, \restrict, and \unrestrict did not free it
after consuming or copying the value.

Free these option strings after use.

Backpatch to all supported versions. In v17 and older, only \restrict
and \unrestrict are affected, so those branches need only that part of
the fix.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwEh3R3=1tx_a5=fTDJ+ycuwxWMEn6bG_Yt4B5P+hE7AVw@mail.gmail.com
Backpatch-through: 14

Branch
------
master

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

Modified Files
--------------
src/bin/psql/command.c | 8 ++++++++
1 file changed, 8 insertions(+)



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

* pgsql: psql: Fix psql slash option leaks
@ 2026-08-19 03:40 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Fujii Masao @ 2026-08-19 03:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

psql: Fix psql slash option leaks

psql_scan_slash_option() returns a malloc'd string, but \getresults,
\gset in pipeline mode, \restrict, and \unrestrict did not free it
after consuming or copying the value.

Free these option strings after use.

Backpatch to all supported versions. In v17 and older, only \restrict
and \unrestrict are affected, so those branches need only that part of
the fix.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwEh3R3=1tx_a5=fTDJ+ycuwxWMEn6bG_Yt4B5P+hE7AVw@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_19_STABLE

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

Modified Files
--------------
src/bin/psql/command.c | 8 ++++++++
1 file changed, 8 insertions(+)



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

* pgsql: psql: Fix psql slash option leaks
@ 2026-08-19 03:40 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Fujii Masao @ 2026-08-19 03:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

psql: Fix psql slash option leaks

psql_scan_slash_option() returns a malloc'd string, but \getresults,
\gset in pipeline mode, \restrict, and \unrestrict did not free it
after consuming or copying the value.

Free these option strings after use.

Backpatch to all supported versions. In v17 and older, only \restrict
and \unrestrict are affected, so those branches need only that part of
the fix.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwEh3R3=1tx_a5=fTDJ+ycuwxWMEn6bG_Yt4B5P+hE7AVw@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/8753b6904e861f15c4889c7e0623580e357860b9

Modified Files
--------------
src/bin/psql/command.c | 8 ++++++++
1 file changed, 8 insertions(+)



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

* pgsql: psql: Fix psql slash option leaks
@ 2026-08-19 03:40 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Fujii Masao @ 2026-08-19 03:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

psql: Fix psql slash option leaks

psql_scan_slash_option() returns a malloc'd string, but \getresults,
\gset in pipeline mode, \restrict, and \unrestrict did not free it
after consuming or copying the value.

Free these option strings after use.

Backpatch to all supported versions. In v17 and older, only \restrict
and \unrestrict are affected, so those branches need only that part of
the fix.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwEh3R3=1tx_a5=fTDJ+ycuwxWMEn6bG_Yt4B5P+hE7AVw@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4c5485aedfa0f4c88b4d951018b85d0302bff5f0

Modified Files
--------------
src/bin/psql/command.c | 6 ++++++
1 file changed, 6 insertions(+)



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

* pgsql: psql: Fix psql slash option leaks
@ 2026-08-19 03:40 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Fujii Masao @ 2026-08-19 03:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

psql: Fix psql slash option leaks

psql_scan_slash_option() returns a malloc'd string, but \getresults,
\gset in pipeline mode, \restrict, and \unrestrict did not free it
after consuming or copying the value.

Free these option strings after use.

Backpatch to all supported versions. In v17 and older, only \restrict
and \unrestrict are affected, so those branches need only that part of
the fix.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwEh3R3=1tx_a5=fTDJ+ycuwxWMEn6bG_Yt4B5P+hE7AVw@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4d2c7beb696b377a3738e0d4d3f7eed4a2e6d75c

Modified Files
--------------
src/bin/psql/command.c | 6 ++++++
1 file changed, 6 insertions(+)



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

* pgsql: psql: Fix psql slash option leaks
@ 2026-08-19 03:40 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Fujii Masao @ 2026-08-19 03:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

psql: Fix psql slash option leaks

psql_scan_slash_option() returns a malloc'd string, but \getresults,
\gset in pipeline mode, \restrict, and \unrestrict did not free it
after consuming or copying the value.

Free these option strings after use.

Backpatch to all supported versions. In v17 and older, only \restrict
and \unrestrict are affected, so those branches need only that part of
the fix.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwEh3R3=1tx_a5=fTDJ+ycuwxWMEn6bG_Yt4B5P+hE7AVw@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_15_STABLE

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

Modified Files
--------------
src/bin/psql/command.c | 6 ++++++
1 file changed, 6 insertions(+)



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

* pgsql: psql: Fix psql slash option leaks
@ 2026-08-19 03:41 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Fujii Masao @ 2026-08-19 03:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

psql: Fix psql slash option leaks

psql_scan_slash_option() returns a malloc'd string, but \getresults,
\gset in pipeline mode, \restrict, and \unrestrict did not free it
after consuming or copying the value.

Free these option strings after use.

Backpatch to all supported versions. In v17 and older, only \restrict
and \unrestrict are affected, so those branches need only that part of
the fix.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwEh3R3=1tx_a5=fTDJ+ycuwxWMEn6bG_Yt4B5P+hE7AVw@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_14_STABLE

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

Modified Files
--------------
src/bin/psql/command.c | 6 ++++++
1 file changed, 6 insertions(+)



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


end of thread, other threads:[~2026-08-19 03:41 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-08-19 03:39 pgsql: psql: Fix psql slash option leaks Fujii Masao <fujii@postgresql.org>
2026-08-19 03:40 pgsql: psql: Fix psql slash option leaks Fujii Masao <fujii@postgresql.org>
2026-08-19 03:40 pgsql: psql: Fix psql slash option leaks Fujii Masao <fujii@postgresql.org>
2026-08-19 03:40 pgsql: psql: Fix psql slash option leaks Fujii Masao <fujii@postgresql.org>
2026-08-19 03:40 pgsql: psql: Fix psql slash option leaks Fujii Masao <fujii@postgresql.org>
2026-08-19 03:40 pgsql: psql: Fix psql slash option leaks Fujii Masao <fujii@postgresql.org>
2026-08-19 03:41 pgsql: psql: Fix psql slash option leaks 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