Commit 4c4f6eec authored by Petri Latvala's avatar Petri Latvala

lib/debugfs: Ensure null-termination in igt_hpd_storm_detected

Read sizeof - 1 to buf so it stays null-terminated.
Signed-off-by: Petri Latvala's avatarPetri Latvala <>
Reviewed-by: Chris Wilson's avatarChris Wilson <>
parent d0e50033
......@@ -628,7 +628,7 @@ bool igt_hpd_storm_detected(int drm_fd)
if (fd < 0)
return false;
igt_assert_lt(0, read(fd, buf, sizeof(buf)));
igt_assert_lt(0, read(fd, buf, sizeof(buf) - 1));
igt_assert(start_loc = strstr(buf, "Detected: "));
igt_assert_eq(sscanf(start_loc, "Detected: %s\n", detected_str), 1);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment