]> 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:52:21 +0000 (01:52 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 29 Jun 2007 01:52:21 +0000 (01:52 +0000)
commit175c3b853aa2e203c57e00dbd306f72316dde159
tree38f537d3544a874c47b3c973c45aebcf06d916b0
parent01e570e68491335fa3902afdb59ca7df7e72bdcc
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