postgresql/src
Peter Eisentraut 9a46324fd4 Fix several one-byte buffer over-reads in to_number
Several places in NUM_numpart_from_char(), which is called from the SQL
function to_number(text, text), could accidentally read one byte past
the end of the input buffer (which comes from the input text datum and
is not null-terminated).

1. One leading space character would be skipped, but there was no check
   that the input was at least one byte long.  This does not happen in
   practice, but for defensiveness, add a check anyway.

2. Commit 4a3a1e2cf apparently accidentally doubled that code that skips
   one space character (so that two spaces might be skipped), but there
   was no overflow check before skipping the second byte.  Fix by
   removing that duplicate code.

3. A logic error would allow a one-byte over-read when looking for a
   trailing sign (S) placeholder.

In each case, the extra byte cannot be read out directly, but looking at
it might cause a crash.

The third item was discovered by Piotr Stefaniak, the first two were
found and analyzed by Tom Lane and Peter Eisentraut.
2016-08-08 11:12:59 -04:00
..
backend Fix several one-byte buffer over-reads in to_number 2016-08-08 11:12:59 -04:00
bin Translation updates 2016-08-08 11:08:00 -04:00
common pgindent run for 9.6 2016-06-09 18:02:36 -04:00
fe_utils Obstruct shell, SQL, and conninfo injection via database and role names. 2016-08-08 10:07:46 -04:00
include Obstruct shell, SQL, and conninfo injection via database and role names. 2016-08-08 10:07:46 -04:00
interfaces Translation updates 2016-08-08 11:08:00 -04:00
makefiles Fix typos in comments and doc 2016-01-28 16:47:36 +09:00
pl Translation updates 2016-08-08 11:08:00 -04:00
port Promote pg_dumpall shell/connstr quoting functions to src/fe_utils. 2016-08-08 10:07:46 -04:00
template Remove some remains from Alpha support removal 2015-10-29 16:40:14 -04:00
test Fix two errors with nested CASE/WHEN constructs. 2016-08-08 10:33:46 -04:00
timezone Update time zone data files to tzdata release 2016f. 2016-08-05 12:59:29 -04:00
tools Obstruct shell, SQL, and conninfo injection via database and role names. 2016-08-08 10:07:46 -04:00
tutorial Update copyright for 2016 2016-01-02 13:33:40 -05:00
.gitignore
DEVELOPERS
Makefile Create src/fe_utils/, and move stuff into there from pg_dump's dumputils. 2016-03-24 15:55:57 -04:00
Makefile.global.in Provide and use a makefile target to build all generated headers. 2016-07-01 15:09:02 -04:00
Makefile.shlib Make the AIX case of Makefile.shlib safe for parallel make. 2016-07-23 20:30:03 -04:00
bcc32.mak
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00
win32.mak