]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cls_rgw_client.cc: fix potential null pointer deref
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Sun, 26 Oct 2014 17:28:50 +0000 (18:28 +0100)
committerSage Weil <sage@redhat.com>
Mon, 27 Oct 2014 19:44:26 +0000 (12:44 -0700)
Fix for:

CID 1054853 (#1 of 1): Dereference before null check (REVERSE_INULL)
 check_after_deref: Null-checking is_truncated suggests that it may
 be null, but it has already been dereferenced on all paths leading
 to the check.

Add vim line to file.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/cls/rgw/cls_rgw_client.cc

index 87d6127ae58c9c34621fc92687405d2f654d22d6..c13c1a1559c62b7c68cbe7f691925bb013f1df54 100644 (file)
@@ -1,3 +1,5 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
 #include <errno.h>
 
 #include "include/types.h"
@@ -251,7 +253,8 @@ int cls_rgw_usage_log_read(IoCtx& io_ctx, string& oid, string& user,
                            string& read_iter, map<rgw_user_bucket, rgw_usage_log_entry>& usage,
                            bool *is_truncated)
 {
-  *is_truncated = false;
+  if (is_truncated)
+    *is_truncated = false;
 
   bufferlist in, out;
   rgw_cls_usage_log_read_op call;