All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrea Cervesato via ltp <ltp@lists.linux.it>
To: "Cyril Hrubis" <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 0/2] Fix proc parsing in newuname01
Date: Wed, 06 May 2026 13:52:08 +0000	[thread overview]
Message-ID: <69fb4789.5d0a0220.2b948b.6eaf@mx.google.com> (raw)
In-Reply-To: <20260409103041.8253-1-chrubis@suse.cz>

Agent didn't send the following email:

--- Reply to [PATCH 1/2] ---

On Thu, 9 Apr 2026, Cyril Hrubis wrote:
> lib: safe_file_ops: Add SAFE_FILE_READ_STR()

Hi Cyril,

> +	f = fopen(path, "r");
> +	if (!f) {
> +		tst_brkm_(file, lineno, TBROK | TERRNO, NULL,
> +		          "Failed to open FILE '%s' for reading", path);
> +	}
> +
> +	if (!fgets(buf, buf_size, f))

Missing return; after tst_brkm_() — f is NULL if fopen failed, so fgets()
dereferences NULL. Every other error path in this file has return; after
tst_brkm_().

Same issue in the fclose() error path below.

> +	size_t len = strlen(buf);

Variable declaration after a statement. Move len to the top of the function
with FILE *f.

> + * It's recomended to use this for various sysfs or procfs files that may be

s/recomended/recommended/

Regards,
LTP AI Reviewer

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com

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

  parent reply	other threads:[~2026-05-06 13:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-09 10:30 [LTP] [PATCH 0/2] Fix proc parsing in newuname01 Cyril Hrubis
2026-04-09 10:30 ` [LTP] [PATCH 1/2] lib: safe_file_ops: Add SAFE_FILE_READ_STR() Cyril Hrubis
2026-04-09 13:35   ` Cyril Hrubis
2026-04-09 10:30 ` [LTP] [PATCH 2/2] syscalls: newuname01: Fix fail on empty domainname Cyril Hrubis
2026-05-06 13:52 ` Andrea Cervesato via ltp [this message]
2026-05-07  7:37   ` [LTP] [PATCH 0/2] Fix proc parsing in newuname01 Cyril Hrubis
2026-05-07  7:44     ` Andrea Cervesato via ltp
2026-05-07  9:06       ` Cyril Hrubis

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=69fb4789.5d0a0220.2b948b.6eaf@mx.google.com \
    --to=ltp@lists.linux.it \
    --cc=andrea.cervesato@suse.com \
    --cc=chrubis@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.