mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-10 17:36:11 +00:00
lib: Fix potential out of bounds access in ring stop code
The subsequet code expects the read() to not have filled the entire buffer, and yet we allow it to do so. Reduce the size passed to read() by 1 to make the code sane. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
This commit is contained in:
parent
4aa2c102b9
commit
78e4c2b449
@ -666,7 +666,7 @@ enum stop_ring_flags igt_get_stop_rings(void)
|
||||
|
||||
fd = igt_debugfs_open("i915_ring_stop", O_RDONLY);
|
||||
igt_assert(fd >= 0);
|
||||
l = read(fd, buf, sizeof(buf));
|
||||
l = read(fd, buf, sizeof(buf)-1);
|
||||
igt_assert(l > 0);
|
||||
igt_assert(l < sizeof(buf));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user