pgbench: fix segfault with empty sql file
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Fri, 12 Feb 2016 20:14:45 +0000 (17:14 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Fri, 12 Feb 2016 20:14:45 +0000 (17:14 -0300)
commitdb94419ffd6833da27176f6cca843483b4515065
tree95d42607c0f577fefed4ff9bb4e6ca87c9a40394
parentd03130d378b5fb071d231a7822784ad87268583a
pgbench: fix segfault with empty sql file

Commit 1d0c3b3f8a introduced a bug that causes pgbench to crash if an
empty script file is specified.  Fix it by rejecting such files at
startup, which is the historical and intended behavior.

Reported-By: Jeff Janes
Discussion: https://www.postgresql.org/message-id/CAMkU=1zxKUbLPOt9hQWFp14pTc=V0cGo2GQBbn2GsK2Pu+8ZfA@mail.gmail.com
src/bin/pgbench/pgbench.c