Skip to content

Commit 1bd2abe

Browse files
dalgaafliewegas
authored andcommitted
cls_rgw_client.cc: fix potential null pointer deref
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>
1 parent 56de4ca commit 1bd2abe

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/cls/rgw/cls_rgw_client.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2+
// vim: ts=8 sw=2 smarttab
13
#include <errno.h>
24

35
#include "include/types.h"
@@ -251,7 +253,8 @@ int cls_rgw_usage_log_read(IoCtx& io_ctx, string& oid, string& user,
251253
string& read_iter, map<rgw_user_bucket, rgw_usage_log_entry>& usage,
252254
bool *is_truncated)
253255
{
254-
*is_truncated = false;
256+
if (is_truncated)
257+
*is_truncated = false;
255258

256259
bufferlist in, out;
257260
rgw_cls_usage_log_read_op call;

0 commit comments

Comments
 (0)