]> Gentwo Git Trees - linux/.git/commit
s390/tape: Use scnprintf() instead of sprintf()
authorHeiko Carstens <hca@linux.ibm.com>
Tue, 7 Oct 2025 09:05:04 +0000 (11:05 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Tue, 21 Oct 2025 08:17:30 +0000 (10:17 +0200)
commitc769941de8bf6ab744bbc7ec7a88c32955d10646
tree9c3c0c14193ed553421023d0bcaa18de2e7cde9b
parentffb5d3af5e2b52472f236f8bb13414c7fab99797
s390/tape: Use scnprintf() instead of sprintf()

Use scnprintf() instead of sprintf() for those cases where the destination
is an array and the size of the array is known at compile time.

This prevents theoretical buffer overflows, but also avoids that people
again and again spend time to figure out if the code is actually safe.

Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Reviewed-by: Jan Polensky <japo@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
drivers/s390/char/tape_char.c