mirror of
https://github.com/ceph/ceph
synced 2025-02-23 19:17:37 +00:00
mon: Monitor: fix potential null-pointer dereference
CID 717443: Dereference after null check (FORWARD_NULL) At (14): Passing null pointer "detailbl" to function "ceph::buffer::list::append(std::string const &)", which dereferences it. Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
This commit is contained in:
parent
64bf7f9b28
commit
52dedc8986
@ -1324,8 +1324,10 @@ void Monitor::get_health(string& status, bufferlist *detailbl, Formatter *f)
|
||||
while (!detail.empty()) {
|
||||
if (f)
|
||||
f->dump_string("item", detail.front().second);
|
||||
detailbl->append(detail.front().second);
|
||||
detailbl->append('\n');
|
||||
if (detailbl != NULL) {
|
||||
detailbl->append(detail.front().second);
|
||||
detailbl->append('\n');
|
||||
}
|
||||
detail.pop_front();
|
||||
}
|
||||
if (f)
|
||||
|
Loading…
Reference in New Issue
Block a user