summaryrefslogtreecommitdiff
path: root/pgsql.c
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2012-04-24 14:53:48 +0200
committerAndreas Baumann <abaumann@yahoo.com>2012-04-24 14:53:48 +0200
commit16a67ba97d13a69b67dd86b01b7479016ff2f9f4 (patch)
tree07316b4729992f1cae76a7d81f1a3557e64596d7 /pgsql.c
parent6dbfae4e2bafac8dabab003814fbe58de0c8a594 (diff)
downloadpgfuse-16a67ba97d13a69b67dd86b01b7479016ff2f9f4.tar.gz
pgfuse-16a67ba97d13a69b67dd86b01b7479016ff2f9f4.tar.bz2
fixed segfault on size==0
Diffstat (limited to 'pgsql.c')
-rw-r--r--pgsql.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pgsql.c b/pgsql.c
index f424b35..684409b 100644
--- a/pgsql.c
+++ b/pgsql.c
@@ -318,6 +318,10 @@ int psql_read_buf( PGconn *conn, const int id, const char *path, char *buf, cons
return tmp;
}
+ if( meta.size == 0 ) {
+ return 0;
+ }
+
size = len;
if( offset + size > meta.size ) {
size = meta.size - offset;