]> granicus.if.org Git - postgresql/commit
Fix a passel of ancient bugs in to_char(), including two distinct buffer
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 29 Jun 2007 01:51:35 +0000 (01:51 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 29 Jun 2007 01:51:35 +0000 (01:51 +0000)
commit6faf7956622c39f21a6b4d0f94d1a43529ad44bf
tree0540f87e870feafa617ab3f86d9921fa4bdeaf7f
parent700eabbe69b6b55b3b2ea8ec5fd229aa707201aa
Fix a passel of ancient bugs in to_char(), including two distinct buffer
overruns (neither of which seem likely to be exploitable as security holes,
fortunately, since the provoker can't control the data written).  One of
these is due to choosing to stomp on the output of a called function, which
is bad news in any case; make it treat the called functions' results as
read-only.  Avoid some unnecessary palloc/pfree traffic too; it's not
really helpful to free small temporary objects, and again this is presuming
more than it ought to about the nature of the results of called functions.
Per report from Patrick Welche and additional code-reading by Imad.
src/backend/utils/adt/formatting.c