mirror of
https://github.com/esphome/esphome.git
synced 2026-06-01 01:19:45 +08:00
[json] NOLINT StackAddressEscape false positive in parse_json (#16091)
This commit is contained in:
@@ -39,7 +39,8 @@ bool parse_json(const uint8_t *data, size_t len, const json_parse_t &f) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
JsonDocument parse_json(const uint8_t *data, size_t len) {
|
JsonDocument parse_json(const uint8_t *data, size_t len) {
|
||||||
// NOLINTBEGIN(clang-analyzer-cplusplus.NewDeleteLeaks) false positive with ArduinoJson
|
// NOLINTBEGIN(clang-analyzer-cplusplus.NewDeleteLeaks,clang-analyzer-core.StackAddressEscape) false positives with
|
||||||
|
// ArduinoJson
|
||||||
if (data == nullptr || len == 0) {
|
if (data == nullptr || len == 0) {
|
||||||
ESP_LOGE(TAG, "No data to parse");
|
ESP_LOGE(TAG, "No data to parse");
|
||||||
return JsonObject(); // return unbound object
|
return JsonObject(); // return unbound object
|
||||||
@@ -63,7 +64,7 @@ JsonDocument parse_json(const uint8_t *data, size_t len) {
|
|||||||
}
|
}
|
||||||
ESP_LOGE(TAG, "Parse error: %s", err.c_str());
|
ESP_LOGE(TAG, "Parse error: %s", err.c_str());
|
||||||
return JsonObject(); // return unbound object
|
return JsonObject(); // return unbound object
|
||||||
// NOLINTEND(clang-analyzer-cplusplus.NewDeleteLeaks)
|
// NOLINTEND(clang-analyzer-cplusplus.NewDeleteLeaks,clang-analyzer-core.StackAddressEscape)
|
||||||
}
|
}
|
||||||
|
|
||||||
SerializationBuffer<> JsonBuilder::serialize() {
|
SerializationBuffer<> JsonBuilder::serialize() {
|
||||||
|
|||||||
Reference in New Issue
Block a user