runner/settings: Fix while loop
PATCH 1/1 runner/settings: Fix while loop
Passing a large argument to the --hook option caused igt_runner to crash. Valgrind identified an issue in read_hook_strs_from_file(), which this patch addresses.
A typo in parenthesis placement caused the assignment of 0 or 1 to line_length, not the actual line length, because != -1 was evaluated before assignment.
--- runner/settings.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
runner/settings.c +1 -1
@@ -1458,7 +1458,7 @@ static bool read_hook_strs_from_file(struct igt_vec *hook_strs, FILE *f) buf =malloc (buf_capacity); -while ((line_length =getline (&line, &line_size, f) !=-1 )) { +while ((line_length =getline (&line, &line_size, f)) !=-1 ) {char *s = line;if (buf_len ==0 ) {
Signature · 1 line
2.43.0
Quoting Peter Senna Tschudin (2025-06-26 17:34:00-03:00)
Quoted 10 lines
Passing a large argument to the --hook option caused
igt_runnerto crash. Valgrind identified an issue inread_hook_strs_from_file(), which this patch addresses.A typo in parenthesis placement caused the assignment of 0 or 1 to
line_length, not the actual line length, because != -1 was evaluated before assignment.Cc Gustavo Sousa <[email protected]>Signed-off-by Peter Senna Tschudin <[email protected]>
And... :facepalm:
Thanks for catching this!
--
Gustavo Sousa
Quoted 20 lines
---
runner/settings.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)runner/settings.c +1
-1@@ -1458,7 +1458,7 @@ static bool read_hook_strs_from_file(struct igt_vec *hook_strs, FILE *f) buf =malloc (buf_capacity); -while ((line_length =getline (&line, &line_size, f) !=-1 )) { +while ((line_length =getline (&line, &line_size, f)) !=-1 ) {char *s = line;if (buf_len ==0 ) {Signature · 1 line
2.43.0
Patchwork
CI✗ Fi.CI.BAT: failure for runner/settings: Fix while loop
In reply to Peter Senna Tschudin== Series Details ==
== Series Details ==
Series: runner/settings: Fix while loop
URL : https://patchwork.freedesktop.org/series/150843/
State : failure
== Summary ==
Series 150843 revision 1 was fully merged or fully failed: no git log