postgresql/src
Tom Lane 8527132e52 Tighten checks for whitespace in functions that parse identifiers etc.
This patch replaces isspace() calls with scanner_isspace() in functions
that are likely to be presented with non-ASCII input.  isspace() has
the small advantage that it will correctly recognize no-break space
in single-byte encodings (such as LATIN1); but it cannot work successfully
for any multibyte character, and depending on platform it might return
false positive results for some fragments of multibyte characters.  That's
disastrous for functions that are trying to discard whitespace between
valid strings, as noted in bug #14662 from Justin Muise.  Even treating
no-break space as whitespace is pretty questionable for the usages touched
here, because the core scanner would think it is an identifier character.

Affected functions are parse_ident(), parseNameAndArgTypes (underlying
regprocedurein() and siblings), SplitIdentifierString (used for parsing
GUCs and options that are qualified names or lists of names), and
SplitDirectoriesString (used for parsing GUCs that are lists of
directories).

All the functions adjusted here are parsing SQL identifiers and similar
constructs, so it's reasonable to insist that their definition of
whitespace match the core scanner.  So we can hope that this won't cause
many backwards-compatibility problems.  I've left alone isspace() calls
in places that aren't really expecting any non-ASCII input characters,
such as float8in().

Back-patch to all supported branches.

Discussion: https://postgr.es/m/10129.1495302480@sss.pgh.pa.us
2017-05-24 15:28:34 -04:00
..
backend Tighten checks for whitespace in functions that parse identifiers etc. 2017-05-24 15:28:34 -04:00
bin Make psql handle EOF during COPY FROM STDIN properly on all platforms. 2017-05-17 12:24:19 -04:00
common pgindent run for 9.6 2016-06-09 18:02:36 -04:00
fe_utils Restore psql's SIGPIPE setting if popen() fails. 2016-12-07 12:39:24 -05:00
include Fix race condition leading to hanging logical slot creation. 2017-05-13 14:21:00 -07:00
interfaces Stamp 9.6.3. 2017-05-08 17:15:12 -04:00
makefiles Fix typos in comments and doc 2016-01-28 16:47:36 +09:00
pl Translation updates 2017-05-08 10:10:54 -04:00
port Stamp 9.6.3. 2017-05-08 17:15:12 -04:00
template Remove some remains from Alpha support removal 2015-10-29 16:40:14 -04:00
test Fix precision and rounding issues in money multiplication and division. 2017-05-21 13:05:17 -04:00
timezone Fix new warnings from GCC 7 2017-05-16 08:52:39 -04:00
tools Update URLs in pgindent source and README 2017-05-23 13:59:48 -04:00
tutorial Update copyright for 2016 2016-01-02 13:33:40 -05:00
.gitignore
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
DEVELOPERS
Makefile Install TAP test infrastructure so it's available for extension testing. 2016-09-23 15:50:00 -04:00
Makefile.global.in Honor PROVE_FLAGS environment setting 2017-05-12 11:21:20 -04:00
Makefile.shlib Fix typos in comments. 2017-02-06 11:34:15 +02:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00