mirror of
https://github.com/nlohmann/json.git
synced 2026-10-24 14:58:54 +00:00
Mark Infer's null dereference in materialize() as a false positive
Infer (ci_infer, also red on develop since #5882) reports a null dereference in json_sax_dom_parser::null() called from materialize(). The member pointer the parser stores a value of an object in is set by the key() before it, so it is not null there. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
2 files changed
+6
No files matched your search
@@ -143,6 +143,9 @@ BasicJsonType materialize(const document_data& d, const node* n)
|
||||
case value_t::binary:
|
||||
case value_t::discarded:
|
||||
default:
|
||||
// false positive: a value in an object follows its key(), which set the
|
||||
// member the parser stores it in
|
||||
// @infer-ignore NULLPTR_DEREFERENCE
|
||||
sax.null();
|
||||
break;
|
||||
}
|
||||
|
||||
Generated
+3
@@ -7185,6 +7185,9 @@ BasicJsonType materialize(const document_data& d, const node* n)
|
||||
case value_t::binary:
|
||||
case value_t::discarded:
|
||||
default:
|
||||
// false positive: a value in an object follows its key(), which set the
|
||||
// member the parser stores it in
|
||||
// @infer-ignore NULLPTR_DEREFERENCE
|
||||
sax.null();
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user