mirror of
https://github.com/postgres/postgres.git
synced 2026-02-24 18:37:22 -05:00
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> |
||
|---|---|---|
| .. | ||
| execdebug.h | ||
| execdesc.h | ||
| executor.h | ||
| functions.h | ||
| hashjoin.h | ||
| instrument.h | ||
| nodeAgg.h | ||
| nodeAppend.h | ||
| nodeBitmapAnd.h | ||
| nodeBitmapHeapscan.h | ||
| nodeBitmapIndexscan.h | ||
| nodeBitmapOr.h | ||
| nodeCtescan.h | ||
| nodeForeignscan.h | ||
| nodeFunctionscan.h | ||
| nodeGroup.h | ||
| nodeHash.h | ||
| nodeHashjoin.h | ||
| nodeIndexonlyscan.h | ||
| nodeIndexscan.h | ||
| nodeLimit.h | ||
| nodeLockRows.h | ||
| nodeMaterial.h | ||
| nodeMergeAppend.h | ||
| nodeMergejoin.h | ||
| nodeModifyTable.h | ||
| nodeNestloop.h | ||
| nodeRecursiveunion.h | ||
| nodeResult.h | ||
| nodeSeqscan.h | ||
| nodeSetOp.h | ||
| nodeSort.h | ||
| nodeSubplan.h | ||
| nodeSubqueryscan.h | ||
| nodeTidscan.h | ||
| nodeUnique.h | ||
| nodeValuesscan.h | ||
| nodeWindowAgg.h | ||
| nodeWorktablescan.h | ||
| spi.h | ||
| spi_priv.h | ||
| tstoreReceiver.h | ||
| tuptable.h | ||