Fix off-by-one in pg_xlogdump's fuzzy_open_file().
authorAndres Freund <andres@anarazel.de>
Sun, 4 Jan 2015 14:35:47 +0000 (15:35 +0100)
committerAndres Freund <andres@anarazel.de>
Sun, 4 Jan 2015 14:35:47 +0000 (15:35 +0100)
commitf0e2770956a8a6975dd70dd0bc3fdec073b50493
tree3ce5edde41a055efd25a33d4e9f6e4fd8e8d6def
parentd33f36f16e6a80b81afe55401917f8d23e924f83
Fix off-by-one in pg_xlogdump's fuzzy_open_file().

In the unlikely case of stdin (fd 0) being closed, the off-by-one
would lead to pg_xlogdump failing to open files.

Spotted by Coverity.

Backpatch to 9.3 where pg_xlogdump was introduced.
contrib/pg_xlogdump/pg_xlogdump.c