[LTP] [PATCH] lib: Fix bug in tst_test metadata validation

Martin Doucha mdoucha@suse.cz
Tue Apr 8 16:09:43 CEST 2025


The results pointer is NULL when do_setup() checks tst_test metadata
validity. Print the invalid runtime value from the correct pointer.

Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---
 lib/tst_test.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/lib/tst_test.c b/lib/tst_test.c
index 9a23cd4a0..694861d95 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -1267,10 +1267,8 @@ static void do_setup(int argc, char *argv[])
 			tst_test->timeout);
 	}
 
-	if (tst_test->runtime < 0) {
-		tst_brk(TBROK, "Invalid runtime value %i",
-			results->runtime);
-	}
+	if (tst_test->runtime < 0)
+		tst_brk(TBROK, "Invalid runtime value %i", tst_test->runtime);
 
 	if (tst_test->tconf_msg)
 		tst_brk(TCONF, "%s", tst_test->tconf_msg);
-- 
2.49.0



More information about the ltp mailing list