postgresql/src/include
Tom Lane 7b40b2d90f Fix latent crash in do_text_output_multiline().
do_text_output_multiline() would fail (typically with a null pointer
dereference crash) if its input string did not end with a newline.  Such
cases do not arise in our current sources; but it certainly could happen
in future, or in extension code's usage of the function, so we should fix
it.  To fix, replace "eol += len" with "eol = text + len".

While at it, make two cosmetic improvements: mark the input string const,
and rename the argument from "text" to "txt" to dodge pgindent strangeness
(since "text" is a typedef name).

Even though this problem is only latent at present, it seems like a good
idea to back-patch the fix, since it's a very simple/safe patch and it's
not out of the realm of possibility that we might in future back-patch
something that expects sane behavior from do_text_output_multiline().

Per report from Hao Lee.

Report: <CAGoxFiFPAGyPAJLcFxTB5cGhTW2yOVBDYeqDugYwV4dEd1L_Ag@mail.gmail.com>
2016-05-23 14:16:41 -04:00
..
access Change various Gin*Is* macros to return 0/1. 2016-03-27 17:47:46 +02:00
bootstrap Fix off-by-one loop count in MapArrayTypeName, and get rid of static array. 2014-12-16 15:35:46 -05:00
catalog Remove trailing commas in enums. 2016-04-14 19:25:17 -07:00
commands Rework internals of changing a type's ownership 2015-12-21 19:49:15 -03:00
executor Fix latent crash in do_text_output_multiline(). 2016-05-23 14:16:41 -04:00
foreign pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
lib Remove tabs after spaces in C comments 2014-05-06 11:26:26 -04:00
libpq Remove code to match IPv4 pg_hba.conf entries to IPv4-in-IPv6 addresses. 2015-02-17 12:49:46 -05:00
mb Remove tabs after spaces in C comments 2014-05-06 11:26:26 -04:00
nodes Avoid leaking memory while evaluating arguments for a table function. 2014-06-19 22:13:54 -04:00
optimizer Fix generation of MergeAppend plans for optimized min/max on expressions. 2013-11-07 13:13:47 -05:00
parser Remove tabs after spaces in C comments 2014-05-06 11:26:26 -04:00
port Improve TranslateSocketError() to handle more Windows error codes. 2016-04-21 16:59:17 -04:00
portability Remove tabs after spaces in C comments 2014-05-06 11:26:26 -04:00
postmaster Remove tabs after spaces in C comments 2014-05-06 11:26:26 -04:00
regex Suppress compiler warnings about useless comparison of unsigned to zero. 2016-02-15 17:11:52 -05:00
replication Remove tabs after spaces in C comments 2014-05-06 11:26:26 -04:00
rewrite Avoid getting more than AccessShareLock when deparsing a query. 2014-03-06 19:31:16 -05:00
snowball Remove tabs after spaces in C comments 2014-05-06 11:26:26 -04:00
storage Introduce durable_rename() and durable_link_or_rename(). 2016-03-09 18:53:54 -08:00
tcop Be more careful to not lose sync in the FE/BE protocol. 2015-02-02 17:09:31 +02:00
tsearch Predict integer overflow to avoid buffer overruns. 2014-02-17 09:33:37 -05:00
utils Cope if platform declares mbstowcs_l(), but not locale_t, in <xlocale.h>. 2016-03-15 13:19:58 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
c.h Remove tabs after spaces in C comments 2014-05-06 11:26:26 -04:00
fmgr.h Remove tabs after spaces in C comments 2014-05-06 11:26:26 -04:00
funcapi.h Remove tabs after spaces in C comments 2014-05-06 11:26:26 -04:00
getaddrinfo.h Fix assorted issues in client host name lookup. 2014-04-02 17:11:34 -04:00
getopt_long.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
Makefile Fix server header file installation with vpath builds 2011-11-10 20:54:50 +02:00
miscadmin.h Perform an immediate shutdown if the postmaster.pid file is removed. 2015-10-06 17:15:27 -04:00
pg_config.h.in Cope if platform declares mbstowcs_l(), but not locale_t, in <xlocale.h>. 2016-03-15 13:19:58 -04:00
pg_config.h.win32 Stamp 9.1.22. 2016-05-09 16:57:25 -04:00
pg_config_manual.h Remove tabs after spaces in C comments 2014-05-06 11:26:26 -04:00
pg_trace.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
pgstat.h Remove tabs after spaces in C comments 2014-05-06 11:26:26 -04:00
pgtar.h Adopt the GNU convention for handling tar-archive members exceeding 8GB. 2015-11-21 20:21:32 -05:00
pgtime.h Support timezone abbreviations that sometimes change. 2014-10-16 15:22:23 -04:00
port.h Revert error-throwing wrappers for the printf family of functions. 2015-05-19 18:18:16 -04:00
postgres.h Adjust DatumGetBool macro, this time for sure. 2016-04-28 11:51:26 -04:00
postgres_ext.h Remove tabs after spaces in C comments 2014-05-06 11:26:26 -04:00
postgres_fe.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
rusagestub.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
windowapi.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00