Skip to content

Commit

Permalink
Merge pull request #12580 from Liuchang0812/fix-clang-warn-client
Browse files Browse the repository at this point in the history
client: fix clang warn of "argument is an uninitialized value"

Reviewed-by: Sage Weil <sage@redhat.com>
  • Loading branch information
John Spray committed Jan 9, 2017
2 parents 572a09c + 883d9b1 commit 96375cd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/client/Client.cc
Expand Up @@ -7143,7 +7143,9 @@ int Client::opendir(const char *relpath, dir_result_t **dirpp, const UserPerm& p
return r;
}
r = _opendir(in.get(), dirpp, perms);
tout(cct) << (unsigned long)*dirpp << std::endl;
/* if ENOTDIR, dirpp will be an uninitialized point and it's very dangerous to access its value */
if (r != -ENOTDIR)
tout(cct) << (unsigned long)*dirpp << std::endl;
return r;
}

Expand Down

0 comments on commit 96375cd

Please sign in to comment.