mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
Per definition vsprint assumes that the provided buffer it writes to is large enough to contain the formatted string. As printf uses a fixed sized buffer (81 bytes) and has no size checks the use of vsprintf can easily cause buffer overflows. Protect against these buffer overflows by using vsnprintf instead. While at it fix a typo in the comment. Reported-by: Marc Hartmayer <mhartmay@linux.ibm.com> Signed-off-by: Philipp Rudo <prudo@linux.ibm.com> Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com> Reviewed-by: Stefan Haberland <sth@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>