aboutsummaryrefslogtreecommitdiff
path: root/src/datastore/plugin_datastore_postgres.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-04-02 09:29:26 +0000
committerChristian Grothoff <christian@grothoff.org>2012-04-02 09:29:26 +0000
commitc9b161c04b8e6349bc2e2856c2d2d02aa03bb1f0 (patch)
treec811e5277ac56aced1cfba19ede4bf85df07cc64 /src/datastore/plugin_datastore_postgres.c
parentdc2fdbef104fb5a1aa752fd1d5c9e9ab0992c914 (diff)
-fix
Diffstat (limited to 'src/datastore/plugin_datastore_postgres.c')
-rw-r--r--src/datastore/plugin_datastore_postgres.c9
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;