Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit db94419

Browse filesBrowse files
committed
pgbench: fix segfault with empty sql file
Commit 1d0c3b3 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
1 parent d03130d commit db94419
Copy full SHA for db94419

File tree

Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed

‎src/bin/pgbench/pgbench.c

Copy file name to clipboardExpand all lines: src/bin/pgbench/pgbench.c
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2686,7 +2686,8 @@ findBuiltin(const char *name, char **desc)
26862686
static void
26872687
addScript(const char *name, Command **commands)
26882688
{
2689-
if (commands == NULL)
2689+
if (commands == NULL ||
2690+
commands[0] == NULL)
26902691
{
26912692
fprintf(stderr, "empty command list for script \"%s\"\n", name);
26922693
exit(1);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.