diff options
Diffstat (limited to 'src/datastore/plugin_datastore_postgres.c')
-rw-r--r-- | src/datastore/plugin_datastore_postgres.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/datastore/plugin_datastore_postgres.c b/src/datastore/plugin_datastore_postgres.c index bbbbf9534d..6dec3146d4 100644 --- a/src/datastore/plugin_datastore_postgres.c +++ b/src/datastore/plugin_datastore_postgres.c @@ -236,13 +236,18 @@ postgres_plugin_estimate_size (void *cls) { return 0; } - if ((PQntuples (ret) != 1) || (PQnfields (ret) != 1) || - (PQgetlength (ret, 0, 0) != sizeof (unsigned long long))) + if ((PQntuples (ret) != 1) || (PQnfields (ret) != 1) ) { GNUNET_break (0); PQclear (ret); return 0; } + if (PQgetlength (ret, 0, 0) != sizeof (unsigned long long)) + { + GNUNET_break (0 == PQgetlength (ret, 0, 0)); + PQclear (ret); + return 0; + } total = GNUNET_ntohll (*(const unsigned long long *) PQgetvalue (ret, 0, 0)); PQclear (ret); return total; |