]> git.ipfire.org Git - thirdparty/openssl.git/commit
crypto/bio/bio_print.c: always terminate output with \0
authorEugene Syromiatnikov <esyr@openssl.org>
Wed, 27 Aug 2025 08:48:20 +0000 (10:48 +0200)
committerNeil Horman <nhorman@openssl.org>
Fri, 29 Aug 2025 16:18:30 +0000 (12:18 -0400)
commit7777db81f89020e08ded92cde6c2da3139a5e200
tree208758173fde62300dba2ad463816d0b139fa199
parentfff4b181bf3d7a53a24b7d975b4b6af4facd1045
crypto/bio/bio_print.c: always terminate output with \0

Man page states that the result is terminated with \0 on error, however,
when the jump to the "out" label is performed in _dopr, writing out \0
is skipped.  Rearrange the end of the routine to make the "out" part
include the overflow calculation and the final \0 writing.

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28177)
crypto/bio/bio_print.c
test/bioprinttest.c