]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libblkid: use snprintf() instead of sprintf()
authorKarel Zak <kzak@redhat.com>
Mon, 6 Oct 2025 13:04:24 +0000 (15:04 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 6 Oct 2025 13:04:24 +0000 (15:04 +0200)
commit041380f4ca7244df624bf7efdb5e27fdd3144175
treedbbfdb6cae0d79ea1020f1a82be5a54f25c594b6
parent92ed1e3a6845fbc78f43ad79b0d09096b5c9ce56
libblkid: use snprintf() instead of sprintf()

Replace sprintf() calls with snprintf() to ensure proper bounds
checking when formatting strings.

In encode.c, the check now validates snprintf() return value instead
of pre-checking buffer size, providing more robust error handling.

In probe.c, snprintf() is used with proper size calculation based on
remaining buffer space.

Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid/src/encode.c
libblkid/src/probe.c