aboutsummaryrefslogtreecommitdiff
path: root/src/backend/replication/logical/logicalfuncs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2016-01-09 13:44:27 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2016-01-09 13:44:49 -0500
commit1cb63c791c7d070c1bb3cce58885c9697d769cd2 (patch)
tree3cf842b6648515ea1b39c5b6a89ea3197885de10 /src/backend/replication/logical/logicalfuncs.c
parentb6028426137532afae00188405fdecf7057b208c (diff)
downloadpostgresql-1cb63c791c7d070c1bb3cce58885c9697d769cd2.tar.gz
postgresql-1cb63c791c7d070c1bb3cce58885c9697d769cd2.zip
Clean up code for widget_in() and widget_out().
Given syntactically wrong input, widget_in() could call atof() with an indeterminate pointer argument, typically leading to a crash; or if it didn't do that, it might return a NULL pointer, which again would lead to a crash since old-style C functions aren't supposed to do things that way. Fix that by correcting the off-by-one syntax test and throwing a proper error rather than just returning NULL. Also, since widget_in and widget_out have been marked STRICT for a long time, their tests for null inputs are just dead code; remove 'em. In the oldest branches, also improve widget_out to use snprintf not sprintf, just to be sure. In passing, get rid of a long-since-useless sprintf into a local buffer that nothing further is done with, and make some other minor coding style cleanups. In the intended regression-testing usage of these functions, none of this is very significant; but if the regression test database were left around in a production installation, these bugs could amount to a minor security hazard. Piotr Stefaniak, Michael Paquier, and Tom Lane
Diffstat (limited to 'src/backend/replication/logical/logicalfuncs.c')
0 files changed, 0 insertions, 0 deletions