summaryrefslogtreecommitdiff
path: root/src/bin/scripts/scripts_parallel.h
diff options
context:
space:
mode:
authorTom Lane2019-08-25 19:04:04 +0000
committerTom Lane2019-08-25 19:04:04 +0000
commit6338fa3e715ad1cb12e0760bf73ffc2a906098ea (patch)
tree65f73fa82cc34c2175cc9c658b58f71948725b7e /src/bin/scripts/scripts_parallel.h
parentfaee5a12ecf13190d7ca11d6dcc7078e494f46ca (diff)
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/[email protected]
Diffstat (limited to 'src/bin/scripts/scripts_parallel.h')
0 files changed, 0 insertions, 0 deletions