zipl/libc: Fix potential buffer overflow in printf
zipl/libc: Fix potential buffer overflow in printf

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 <7bafc8cd4e6394916d396e4f8cde69753be8d066@linux.ibm.com>
Signed-off-by: Philipp Rudo <ebc9ed60c9e1dc6a17c00cf7f6009c740d3c3928@linux.ibm.com>
Reviewed-by: Marc Hartmayer <7bafc8cd4e6394916d396e4f8cde69753be8d066@linux.ibm.com>
Reviewed-by: Stefan Haberland <dec981e3bbb165d021029c42291faf06f59827c1@linux.ibm.com>
Signed-off-by: Jan Höppner <96138615ab4af0813785fa10d283f3d37eca3b78@linux.ibm.com>

ibm-s390-tools/s390-tools,ibm-s390-tools/s390-tools,ibm-s390-tools/s390-tools,ibm-s390-tools/s390-tools