[openssl/openssl] f29243: BIO_vprintf: fix off-by-one at 512-byte buffer bou...

"'Mounir IDRASSI' via openssl-commits" <[email protected]> Wed, 08 Jul 2026 04:27:37 -0700
Newsgroups gmane.comp.encryption.openssl.cvs
Message-ID <openssl/openssl/push/refs/heads/master/[email protected]>
  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: f2924392d32968f550afc0051c1108b1d553d6e1
      https://github.com/openssl/openssl/commit/f2924392d32968f550afc0051c1108b1d553d6e1
  Author: Mounir IDRASSI <[email protected]>
  Date:   2026-07-08 (Wed, 08 Jul 2026)

  Changed paths:
    M crypto/bio/bio_print.c
    M test/bio_core_test.c

  Log Message:
  -----------
  BIO_vprintf: fix off-by-one at 512-byte buffer boundary

BIO_vprintf() first formats into a 512-byte stack buffer. Since
vsnprintf() returns the required length excluding the NUL, a return
value of 512 means truncation. The old strict greater-than check
therefore wrote the truncated buffer for exactly 512-byte output.

Use >= for the realloc path and add boundary coverage for 511-, 512-
and 513-byte outputs.

Fixes: a29d157fdb6d "Replace homebrewed implementation of *printf*() functions with libc"

Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Eugene Syromiatnikov <[email protected]>
MergeDate: Wed Jul  8 11:24:31 2026
(Merged from https://github.com/openssl/openssl/pull/31842)



To unsubscribe from these emails, change your notification settings at https://github.com/openssl/openssl/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups "openssl-commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/a/openssl.org/d/msgid/openssl-commits/openssl/openssl/push/refs/heads/master/d9671f-f29243%40github.com.