intel/tools/error: Fix null termination of ring name string.
Ported from intel_error_decode. We don't want to run off the end. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
@@ -559,6 +559,7 @@ read_data_file(FILE *file)
|
||||
free(ring_name);
|
||||
ring_name = malloc(dashes - line);
|
||||
strncpy(ring_name, line, dashes - line);
|
||||
ring_name[dashes - line - 1] = '\0';
|
||||
|
||||
dashes += 4;
|
||||
for (b = buffers; b->match; b++) {
|
||||
|
||||
Reference in New Issue
Block a user