Log Message:
-----------
crypto/bio/bio_print.c: avoid signed int overow in padlen calculation in fmtstr
In a highly unlikely situation of str being longer than INT_MAX,
a signed integer overflow in padlen calculation can be triggered.
Avoid it by reworking the check for the need of padlen calculation.
Fixes: 230c691a5218 "Fix fmtstr for BIO_printf() et al"
Signed-off-by: Eugene Syromiatnikov <es...@openssl.org>
Log Message:
-----------
crypto/bio/bio_print.c: improve handling of unreasonably large widths/precisions
As fmt*() routines try to loop all the way up to pad sizes calculated
based on the user-provided width and precision specification,
it is relatively simple to trigger billions of loop iterations
by providing appropriate width and precision specification, even
if printing is done in a statically-sized buffer. Avoid those
by introducing a helper eob_ok() function, that allows short-circuiting
those loops.