All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Martin Doucha <mdoucha@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] lib: Fix bug in tst_test metadata validation
Date: Fri, 11 Apr 2025 13:59:39 +0200	[thread overview]
Message-ID: <20250411115939.GB323772@pevik> (raw)
In-Reply-To: <20250408140944.36020-1-mdoucha@suse.cz>

Hi Martin,

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

Ah, core dump.  Good catch, thanks!

Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr

> 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);

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2025-04-11 12:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-08 14:09 [LTP] [PATCH] lib: Fix bug in tst_test metadata validation Martin Doucha
2025-04-11 11:59 ` Petr Vorel [this message]
2025-04-11 12:00 ` Petr Vorel
2025-04-11 12:11 ` Cyril Hrubis
2025-04-11 13:02   ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250411115939.GB323772@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=mdoucha@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.