lib: Fix bug in tst_test metadata validation
PATCH 1/1 lib: Fix bug in tst_test metadata validation
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 <[email protected]>
--- lib/tst_test.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
lib/tst_test.c +2 -4
@@ -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);
Signature · 5 lines
2.49.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Martin,
Quoted 2 lines
The results pointer is NULL when
do_setup()checkstst_testmetadata validity. Print the invalid runtime value from the correct pointer.
Ah, core dump. Good catch, thanks!
Reviewed-by Petr Vorel <[email protected]>
Kind regards,
Petr
Quoted 22 lines
Signed-off-by Martin Doucha <[email protected]>--- lib/tst_test.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)lib/tst_test.c +2
-4@@ -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);
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Also:
Fixes a6a369c5ee ("lib: redefine the overall timeout logic of test")
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Hi!
Good catch.
Reviewed-by Cyril Hrubis <[email protected]>
Signature · 5 lines
Cyril Hrubis [email protected] -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi all,
fix merged, thanks!
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp