From: Jinseok Kim <always.starving0@gmail.com>
To: andrea.cervesato@suse.com
Cc: ltp@lists.linux.it
Subject: [LTP] [PATCH v3] inotify: replace strcpy() with snprintf()
Date: Wed, 18 Mar 2026 02:00:57 +0900 [thread overview]
Message-ID: <20260317170058.1229-1-always.starving0@gmail.com> (raw)
In-Reply-To: <69b9216e.df0a0220.302919.f339@mx.google.com>
Hi,
Is replacing
static char fname1[BUF_SIZE], fname2[BUF_SIZE], fname3[BUF_SIZE];
with
static char fname1[PATH_MAX], fname2[PATH_MAX], fname3[PATH_MAX];
considered sufficient here?
The -Wformat-truncation warning still occurs:
snprintf(fname2, sizeof(fname2), "%s.rename1", fname1);
snprintf(fname3, sizeof(fname3), "%s.rename2", fname1);
Since fname1 can already be PATH_MAX bytes long, appending a suffix
like ".rename1" or ".rename2" may exceed PATH_MAX.
Is it acceptable to keep this warning as-is, or should this be handled
differently?
Thanks,
Jinseok.
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-03-17 17:01 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-01 16:57 [LTP] [PATCH] inotify: clean up build and make check findings Jinseok Kim
2026-03-03 15:46 ` Andrea Cervesato via ltp
2026-03-06 7:20 ` Jinseok Kim
2026-03-06 11:28 ` Cyril Hrubis
2026-03-09 14:48 ` Jinseok Kim
2026-03-13 16:05 ` [LTP] [PATCH v2 1/2] inotify: replace strcpy() with snprintf() Jinseok Kim
2026-03-13 16:05 ` [LTP] [PATCH v2 2/2] inotify: fix make check findings Jinseok Kim
2026-03-16 12:31 ` Andrea Cervesato via ltp
2026-05-12 15:38 ` Jinseok Kim
2026-03-16 12:30 ` [LTP] [PATCH v2 1/2] inotify: replace strcpy() with snprintf() Andrea Cervesato via ltp
2026-03-16 15:44 ` [LTP] [PATCH v3] " Jinseok Kim
2026-03-17 9:39 ` Andrea Cervesato via ltp
2026-03-17 17:00 ` Jinseok Kim [this message]
2026-03-18 13:40 ` Andrea Cervesato via ltp
2026-05-12 15:34 ` Jinseok Kim
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=20260317170058.1229-1-always.starving0@gmail.com \
--to=always.starving0@gmail.com \
--cc=andrea.cervesato@suse.com \
--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 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.