All of lore.kernel.org
 help / color / mirror / Atom feed
From: linuxtestproject.agent@gmail.com
To: Tomas Dzik <tdzik@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] LTP/Lite test float_trigo core dumps due to free(): invalid pointer
Date: Thu,  9 Jul 2026 16:34:33 +0000	[thread overview]
Message-ID: <20260709163433.4095-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <79d9ea8ebe3e77733d65fba85ef1940e6f263925.1783610933.git.tdzik@redhat.com>

Hi Tomas,

On Thu, 09 Jul 2026 17:40:04 +0200, Tomas Dzik wrote:
> LTP/Lite test float_trigo core dumps due to free(): invalid pointer

--- [PATCH 1/3] ---

> If malloc() inside function read_file() fails and return value is
> not checked, the current code runs free() on uninitialized pointer.

The return value of read_file() is checked by thread_code() via
`if (fsize == (size_t) 0)`. Is the description perhaps trying to say
that read_file() does not initialize *data on failure paths, so the
caller ends up calling SAFE_FREE() on an uninitialized pointer?

The fix itself is correct -- initializing din and dex to NULL ensures
SAFE_FREE() is a no-op on the error path.

--- [PATCH 3/3] ---

> -	sprintf(funct, "%s/gensinh", bin_path);
> +	snprintf(funct, strlen(bin_path) + MAX_FNAME_LEN,
> +		"%s/gensinh", bin_path);
>  	child = create_file(funct, 0);
>  	waitpid(child, NULL, 0);
>
>  	sprintf(funct, "%s/gentanh", bin_path);
> +	snprintf(funct, strlen(bin_path) + MAX_FNAME_LEN,
> +		"%s/gentanh", bin_path);

The sprintf() line for "gentanh" in geniperb.c was not removed. Both
calls are present in the result: the old sprintf() writes the path,
then the new snprintf() overwrites it with the same value, and
create_file() runs once. Functionally identical, but the unreplaced
sprintf() is the exact call this patch is meant to eliminate.

Verdict - Needs revision

---
Note:

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer

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

  reply	other threads:[~2026-07-09 16:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-09 15:40 [LTP] [PATCH 0/3] Fix to float_trigo core dump and related enhancements Tomas Dzik via ltp
2026-07-09 15:40 ` [LTP] [PATCH 1/3] LTP/Lite test float_trigo core dumps due to free(): invalid pointer Tomas Dzik via ltp
2026-07-09 16:34   ` linuxtestproject.agent [this message]
2026-07-09 15:40 ` [LTP] [PATCH 2/3] Add some checks for malloc() returning NULL Tomas Dzik via ltp
2026-07-09 15:40 ` [LTP] [PATCH 3/3] Replace sprintf() with more secure snprintf() variant in float tests Tomas Dzik via ltp
  -- strict thread matches above, loose matches on Subject: below --
2026-07-08  9:37 [LTP] [PATCH] LTP/Lite test float_trigo core dumps due to free(): invalid pointer Tomas Dzik via ltp
2026-07-08 10:21 ` [LTP] " linuxtestproject.agent

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=20260709163433.4095-1-linuxtestproject.agent@gmail.com \
    --to=linuxtestproject.agent@gmail.com \
    --cc=ltp@lists.linux.it \
    --cc=tdzik@redhat.com \
    /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.