Module: Mesa
Branch: master
Commit: eb8ad56ed2ee005ae7bbff3ff87fb1bcc1b6e4f1
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=eb8ad56ed2ee005ae7bbff3ff87fb1bcc1b6e4f1

Author: Kenneth Graunke <[email protected]>
Date:   Sat Nov 11 22:51:07 2017 -0800

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 <[email protected]>

---

 src/intel/tools/aubinator_error_decode.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/intel/tools/aubinator_error_decode.c 
b/src/intel/tools/aubinator_error_decode.c
index 9cd0fa761d..f9d14cc20d 100644
--- a/src/intel/tools/aubinator_error_decode.c
+++ b/src/intel/tools/aubinator_error_decode.c
@@ -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++) {

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to