From: Nehuen Lian Bova <nehuenlian.kernel@gmail.com>
To: jikos@kernel.org, bentiss@kernel.org
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] HID: wacom: replace sprintf calls with safer alternatives in wacom_sys.c
Date: Sat, 7 Nov 2026 22:23:27 -0300 [thread overview]
Message-ID: <20261108012327.89115-1-nehuenlian.kernel@gmail.com> (raw)
In-Reply-To: <CANRwn3SnB97Oeg4rKBiYX2DD9r51Km5Cf3kpnAn7s2xd42c0BA@mail.gmail.com>
> If you're going through the effort to use snprintf the string, you
> might as well also read its return value to check to check for
> truncation (return value greater than or equal to size) and handle
> such an error condition appropriately.
>
> Jason (she/they)
I didn't check the return value because I noticed in almost every
situation snprintf() is used, the return value wasn't checked.
Anyway, would be a good idea to return -ENAMETOOLONG after
checking if return value >= sizeof(bat_name)?
Or using scnprintf() instead of snprintf() could be a cleaner option?
:)
--
Nehuen Lian Bova
next prev parent reply other threads:[~2026-11-08 1:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-01 1:14 [PATCH] HID: wacom: replace sprintf calls with sysfs_emit calls " Nehuen Lian Bova
2026-11-01 5:48 ` [PATCH v2] HID: wacom: replace sprintf calls with safer alternatives Nehuen Lian Bova
2026-11-01 7:18 ` [PATCH v3] HID: wacom: replace sprintf calls with safer alternatives in wacom_sys.c Nehuen Lian Bova
2026-11-02 19:40 ` Jason Gerecke
2026-11-08 1:23 ` Nehuen Lian Bova [this message]
2026-11-03 5:32 ` [PATCH v2] HID: wacom: replace sprintf calls with safer alternatives kernel test robot
2026-11-03 9:25 ` kernel test robot
2026-11-03 10:56 ` kernel test robot
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=20261108012327.89115-1-nehuenlian.kernel@gmail.com \
--to=nehuenlian.kernel@gmail.com \
--cc=bentiss@kernel.org \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®