postgresql/src/include/executor
Tom Lane de521989a2 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
..
execdebug.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
execdesc.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
executor.h Fix latent crash in do_text_output_multiline(). 2016-05-23 14:16:41 -04:00
functions.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
hashjoin.h Remove tabs after spaces in C comments 2014-05-06 11:26:28 -04:00
instrument.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeAgg.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeAppend.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeBitmapAnd.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeBitmapHeapscan.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeBitmapIndexscan.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeBitmapOr.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeCtescan.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeForeignscan.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeFunctionscan.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeGroup.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeHash.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeHashjoin.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeIndexonlyscan.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeIndexscan.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeLimit.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeLockRows.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeMaterial.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeMergeAppend.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeMergejoin.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeModifyTable.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeNestloop.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeRecursiveunion.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeResult.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeSeqscan.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeSetOp.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeSort.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeSubplan.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeSubqueryscan.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeTidscan.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeUnique.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeValuesscan.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeWindowAgg.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodeWorktablescan.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
spi.h Prevent leakage of SPI tuple tables during subtransaction abort. 2013-07-25 16:45:47 -04:00
spi_priv.h Remove tabs after spaces in C comments 2014-05-06 11:26:28 -04:00
tstoreReceiver.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
tuptable.h Remove tabs after spaces in C comments 2014-05-06 11:26:28 -04:00