postgresql/src/include/executor
Tom Lane a0cc89a281 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 copyright for 2014 2014-01-07 16:05:30 -05:00
execdesc.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
executor.h Fix latent crash in do_text_output_multiline(). 2016-05-23 14:16:41 -04:00
functions.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
hashjoin.h pgindent run for 9.4 2014-05-06 12:12:18 -04:00
instrument.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeAgg.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeAppend.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeBitmapAnd.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeBitmapHeapscan.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeBitmapIndexscan.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeBitmapOr.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeCtescan.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeForeignscan.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeFunctionscan.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeGroup.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeHash.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeHashjoin.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeIndexonlyscan.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeIndexscan.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeLimit.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeLockRows.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeMaterial.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeMergeAppend.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeMergejoin.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeModifyTable.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeNestloop.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeRecursiveunion.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeResult.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeSeqscan.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeSetOp.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeSort.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeSubplan.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeSubqueryscan.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeTidscan.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeUnique.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeValuesscan.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeWindowAgg.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
nodeWorktablescan.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
spi.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
spi_priv.h pgindent run for 9.4 2014-05-06 12:12:18 -04:00
tstoreReceiver.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
tuptable.h pgindent run for 9.4 2014-05-06 12:12:18 -04:00