After the read() the jason_data null termination is missing
for the case "indent < 0", for "indent > 0" and "indent == 0"
cases null termination is already handled.
So add the missing case "indent < 0" to the existing "indent == 0"
case to fix null termination.
Coverity issue: 337680
Fixes:
a63504a90f ("examples/power: add JSON string handling")
Cc: stable@dpdk.org
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
indent--;
if ((indent > 0) || (idx > 0))
idx++;
- if (indent == 0)
+ if (indent <= 0)
json_data[idx] = 0;
if (idx >= MAX_JSON_STRING_LEN-1)
break;