Adjust the behavior of the PQExpBuffer code to make it have well-defined
authorTom Lane <[email protected]>
Wed, 26 Nov 2008 00:26:23 +0000 (00:26 +0000)
committerTom Lane <[email protected]>
Wed, 26 Nov 2008 00:26:23 +0000 (00:26 +0000)
commit09611425dc1f41fec231f8061a50459595124bba
tree6452fc4e80c25da05a549cfcb791defc4ce80262
parentfffe0b039ab452295953c9d30956bf24ce2fef63
Adjust the behavior of the PQExpBuffer code to make it have well-defined
results (ie, an empty "broken" buffer) if memory overrun occurs anywhere
along the way to filling the buffer.  The previous coding would just silently
discard portions of the intended buffer contents, as exhibited in trouble
report from Sam Mason.  Also, tweak psql's main loop to correctly detect
and report such overruns.  There's probably much more that should be done
in this line, but this is a start.
src/bin/psql/input.c
src/bin/psql/mainloop.c
src/bin/psql/psqlscan.l
src/interfaces/libpq/fe-connect.c
src/interfaces/libpq/pqexpbuffer.c
src/interfaces/libpq/pqexpbuffer.h