]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librados: Allow rados_pool_list() to get NULL buffer if len == 0
authorDavid Zafman <david.zafman@inktank.com>
Thu, 3 Apr 2014 02:44:44 +0000 (19:44 -0700)
committerDavid Zafman <david.zafman@inktank.com>
Wed, 9 Apr 2014 02:30:49 +0000 (19:30 -0700)
Coverity wants a NULL check for buf, but caller should be able to
pass a NULL buf and 0 len in order to get byte count of pool list.

Signed-off-by: David Zafman <david.zafman@inktank.com>
src/librados/librados.cc

index 80f2c63b21aeae2b90f5e285c9358e22a9eed9bb..994123bf1ccb1e808e4c80e379d29cec690fe6c5 100644 (file)
@@ -2035,7 +2035,7 @@ extern "C" int rados_pool_list(rados_t cluster, char *buf, size_t len)
   if (r < 0)
     return r;
 
-  if (!buf)
+  if (len > 0 && !buf)
     return -EINVAL;
 
   char *b = buf;