The ctf metadata is written to the metadata file without any check for
length, so this string must be null terminated.
Fixes:
f1a099f5b1f1 ("trace: create CTF TDSL metadata in memory")
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Sunil Kumar Kori <skori@mavell.com>
if (rc < 0)
return rc;
- ptr = realloc(ptr, count + rc);
+ ptr = realloc(ptr, count + rc + 1);
if (ptr == NULL)
goto free_str;
memcpy(RTE_PTR_ADD(ptr, count), str, rc);
+ ptr[count + rc] = '\0';
count += rc;
free(str);