diff options
author | Noah Misch <noah@leadboat.com> | 2018-02-26 07:39:48 -0800 |
---|---|---|
committer | Noah Misch <noah@leadboat.com> | 2018-02-26 07:39:48 -0800 |
commit | 461c32b557ddbb0ed67b4b2232a191554ad40c3c (patch) | |
tree | 22e31fa9e446c72ddb2064a3490513e06334eb8c /src/bin/pg_dump/pg_dump.c | |
parent | 9f6e5296a15f541b04ecdfc077957ccaf2f6e49a (diff) |
Back-patch non-static ExecuteSqlQueryForSingleRow().
Back-patch a subset of commit 47e59697679a0877e0525c565b1be437487604a7
to 9.4 and 9.3. The next commit adds calls to this function.
Security: CVE-2018-1058
Diffstat (limited to 'src/bin/pg_dump/pg_dump.c')
-rw-r--r-- | src/bin/pg_dump/pg_dump.c | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 7fd3ff300b8..10607644889 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -281,7 +281,6 @@ static bool nonemptyReloptions(const char *reloptions); static void fmtReloptionsArray(Archive *fout, PQExpBuffer buffer, const char *reloptions, const char *prefix); static char *get_synchronized_snapshot(Archive *fout); -static PGresult *ExecuteSqlQueryForSingleRow(Archive *fout, char *query); static void setupDumpWorker(Archive *AHX, RestoreOptions *ropt); @@ -15638,26 +15637,3 @@ fmtReloptionsArray(Archive *fout, PQExpBuffer buffer, const char *reloptions, if (options) free(options); } - -/* - * Execute an SQL query and verify that we got exactly one row back. - */ -static PGresult * -ExecuteSqlQueryForSingleRow(Archive *fout, char *query) -{ - PGresult *res; - int ntups; - - res = ExecuteSqlQuery(fout, query, PGRES_TUPLES_OK); - - /* Expecting a single result only */ - ntups = PQntuples(res); - if (ntups != 1) - exit_horribly(NULL, - ngettext("query returned %d row instead of one: %s\n", - "query returned %d rows instead of one: %s\n", - ntups), - ntups, query); - - return res; -} |