pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Avoid platform-specific null pointer dereference in psql.
7+ messages / 1 participants
[nested] [flat]

* pgsql: Avoid platform-specific null pointer dereference in psql.
@ 2019-08-25 19:04 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2019-08-25 19:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid platform-specific null pointer dereference in psql.

POSIX permits getopt() to advance optind beyond argc when the last
argv entry is an option that requires an argument and hasn't got one.
It seems that no major platforms actually do that, but musl does,
so that something like "psql -f" would crash with that libc.
Add a check that optind is in range before trying to look at the
possibly-bogus option.

Report and fix by Quentin Rameau.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/20190825100617.GA6087@fifth.space

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6338fa3e715ad1cb12e0760bf73ffc2a906098ea

Modified Files
--------------
src/bin/psql/startup.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)



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

* pgsql: Avoid platform-specific null pointer dereference in psql.
@ 2019-08-25 19:04 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2019-08-25 19:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid platform-specific null pointer dereference in psql.

POSIX permits getopt() to advance optind beyond argc when the last
argv entry is an option that requires an argument and hasn't got one.
It seems that no major platforms actually do that, but musl does,
so that something like "psql -f" would crash with that libc.
Add a check that optind is in range before trying to look at the
possibly-bogus option.

Report and fix by Quentin Rameau.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/20190825100617.GA6087@fifth.space

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/363382521eb26106587c7dab7f439636c3a6876a

Modified Files
--------------
src/bin/psql/startup.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)



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

* pgsql: Avoid platform-specific null pointer dereference in psql.
@ 2019-08-25 19:04 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2019-08-25 19:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid platform-specific null pointer dereference in psql.

POSIX permits getopt() to advance optind beyond argc when the last
argv entry is an option that requires an argument and hasn't got one.
It seems that no major platforms actually do that, but musl does,
so that something like "psql -f" would crash with that libc.
Add a check that optind is in range before trying to look at the
possibly-bogus option.

Report and fix by Quentin Rameau.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/20190825100617.GA6087@fifth.space

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5fc7b1e939c432439f7c74885b7d053e5c1cab6f

Modified Files
--------------
src/bin/psql/startup.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)



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

* pgsql: Avoid platform-specific null pointer dereference in psql.
@ 2019-08-25 19:04 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2019-08-25 19:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid platform-specific null pointer dereference in psql.

POSIX permits getopt() to advance optind beyond argc when the last
argv entry is an option that requires an argument and hasn't got one.
It seems that no major platforms actually do that, but musl does,
so that something like "psql -f" would crash with that libc.
Add a check that optind is in range before trying to look at the
possibly-bogus option.

Report and fix by Quentin Rameau.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/20190825100617.GA6087@fifth.space

Branch
------
REL_10_STABLE

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

Modified Files
--------------
src/bin/psql/startup.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)



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

* pgsql: Avoid platform-specific null pointer dereference in psql.
@ 2019-08-25 19:04 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2019-08-25 19:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid platform-specific null pointer dereference in psql.

POSIX permits getopt() to advance optind beyond argc when the last
argv entry is an option that requires an argument and hasn't got one.
It seems that no major platforms actually do that, but musl does,
so that something like "psql -f" would crash with that libc.
Add a check that optind is in range before trying to look at the
possibly-bogus option.

Report and fix by Quentin Rameau.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/20190825100617.GA6087@fifth.space

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/28d2ce3c7c992c1aa2bbab984f14bf98056f3864

Modified Files
--------------
src/bin/psql/startup.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)



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

* pgsql: Avoid platform-specific null pointer dereference in psql.
@ 2019-08-25 19:04 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2019-08-25 19:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid platform-specific null pointer dereference in psql.

POSIX permits getopt() to advance optind beyond argc when the last
argv entry is an option that requires an argument and hasn't got one.
It seems that no major platforms actually do that, but musl does,
so that something like "psql -f" would crash with that libc.
Add a check that optind is in range before trying to look at the
possibly-bogus option.

Report and fix by Quentin Rameau.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/20190825100617.GA6087@fifth.space

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/65b1cad5a0929e685e79f7e84f56e0f28a54107a

Modified Files
--------------
src/bin/psql/startup.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)



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

* pgsql: Avoid platform-specific null pointer dereference in psql.
@ 2019-08-25 19:04 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2019-08-25 19:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid platform-specific null pointer dereference in psql.

POSIX permits getopt() to advance optind beyond argc when the last
argv entry is an option that requires an argument and hasn't got one.
It seems that no major platforms actually do that, but musl does,
so that something like "psql -f" would crash with that libc.
Add a check that optind is in range before trying to look at the
possibly-bogus option.

Report and fix by Quentin Rameau.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/20190825100617.GA6087@fifth.space

Branch
------
REL9_4_STABLE

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

Modified Files
--------------
src/bin/psql/startup.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)



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


end of thread, other threads:[~2019-08-25 19:04 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-08-25 19:04 pgsql: Avoid platform-specific null pointer dereference in psql. Tom Lane <tgl@sss.pgh.pa.us>
2019-08-25 19:04 pgsql: Avoid platform-specific null pointer dereference in psql. Tom Lane <tgl@sss.pgh.pa.us>
2019-08-25 19:04 pgsql: Avoid platform-specific null pointer dereference in psql. Tom Lane <tgl@sss.pgh.pa.us>
2019-08-25 19:04 pgsql: Avoid platform-specific null pointer dereference in psql. Tom Lane <tgl@sss.pgh.pa.us>
2019-08-25 19:04 pgsql: Avoid platform-specific null pointer dereference in psql. Tom Lane <tgl@sss.pgh.pa.us>
2019-08-25 19:04 pgsql: Avoid platform-specific null pointer dereference in psql. Tom Lane <tgl@sss.pgh.pa.us>
2019-08-25 19:04 pgsql: Avoid platform-specific null pointer dereference in psql. Tom Lane <tgl@sss.pgh.pa.us>

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