Linux Test Project
 help / color / mirror / Atom feed
From: linuxtestproject.agent@gmail.com
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] fallocate01: Convert to new API
Date: Mon, 20 Jul 2026 13:16:33 +0000	[thread overview]
Message-ID: <20260720131633.4154-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20260720-convert_fallocate_suite-v1-1-50ae85c56c03@suse.com>

Hi Andrea,

On Mon, 20 Jul 2026 13:48:26 +0200, Andrea Cervesato wrote:
> fallocate01: Convert to new API

--- [PATCH 1/2] ---

> +static void setup(void)
> +{
> +	char fname[NAME_MAX];
> +	struct stat file_stat;
> +
> +	snprintf(fname, sizeof(fname), "tfile_%d", getpid());

The filename buffer is one byte short. Per the LTP coding standard
(c-tests.md, "Path Buffers" section), a buffer holding only a filename
component must be NAME_MAX + 1 bytes to accommodate the null terminator
when the filename is exactly NAME_MAX characters long.

In this specific case the generated name is at most ~29 bytes and there
is no actual overflow, but the declaration should still read:

	char fname[NAME_MAX + 1];

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-20 13:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-20 11:48 [LTP] [PATCH 0/2] Convert fallocate testing suite Andrea Cervesato
2026-07-20 11:48 ` [LTP] [PATCH 1/2] fallocate01: Convert to new API Andrea Cervesato
2026-07-20 13:16   ` linuxtestproject.agent [this message]
2026-07-20 11:48 ` [LTP] [PATCH 2/2] fallocate02: " Andrea Cervesato

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=20260720131633.4154-1-linuxtestproject.agent@gmail.com \
    --to=linuxtestproject.agent@gmail.com \
    --cc=andrea.cervesato@suse.de \
    --cc=ltp@lists.linux.it \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox