postgres/src
Tom Lane c693c5c490 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
2019-08-25 15:04:04 -04:00
..
backend Fix bogus comment 2019-08-20 16:04:09 -04:00
bin Avoid platform-specific null pointer dereference in psql. 2019-08-25 15:04:04 -04:00
common Fix portability failure introduced in commits d2b0b60e7 et al. 2018-12-26 15:30:40 -05:00
include Stamp 9.4.24. 2019-08-05 17:22:47 -04:00
interfaces Stamp 9.4.24. 2019-08-05 17:22:47 -04:00
makefiles Define WIN32_STACK_RLIMIT throughout win32 and cygwin builds. 2019-04-09 08:25:43 -07:00
pl Fix C++ incompatibilities in plpgsql's header files. 2019-05-31 12:34:55 -04:00
port Stamp 9.4.24. 2019-08-05 17:22:47 -04:00
template Yet further rethinking of build changes for macOS Mojave. 2018-11-02 18:54:00 -04:00
test Prevent possible double-free when update trigger returns old tuple. 2019-08-15 20:04:19 -04:00
timezone Tweak our special-case logic for the IANA "Factory" timezone. 2019-07-26 13:07:08 -04:00
tools Fix syntax error in commit 20e99cddd. 2019-07-25 14:42:30 -04:00
tutorial pgindent run for 9.4 2014-05-06 12:12:18 -04:00
.gitignore
bcc32.mak
DEVELOPERS
Makefile Install TAP test infrastructure so it's available for extension testing. 2016-09-23 15:50:00 -04:00
Makefile.global.in Handle USE_MODULE_DB for all tests able to use an installed postmaster. 2019-04-03 17:10:42 -07:00
Makefile.shlib Ensure static libraries have correct mod time even if ranlib messes it up. 2018-11-29 15:53:44 -05:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00
win32.mak