diff options
author | schwarze <> | 2021-11-27 13:10:33 +0000 |
---|---|---|
committer | schwarze <> | 2021-11-27 13:10:33 +0000 |
commit | cbb1afa6429df7a3087dd6a337b730e5304ed3bb (patch) | |
tree | f06a4ef6cb4d8f2ab19d76c189b8cd4bb2d5fa22 /src/lib/libcrypto/man/BIO_new.3 | |
parent | 6a2276e5a7885ebbd30cb16c476c7652740dc5ef (diff) | |
download | openbsd-cbb1afa6429df7a3087dd6a337b730e5304ed3bb.tar.gz openbsd-cbb1afa6429df7a3087dd6a337b730e5304ed3bb.tar.bz2 openbsd-cbb1afa6429df7a3087dd6a337b730e5304ed3bb.zip |
Fix incomplete initialization bug: BIO_new(BIO_f_asn1()) neglected
initializing five of the fields in BIO_ASN1_BUF_CTX (prefix,
prefix_free, suffix, suffix_free, ex_arg), inviting a segfault in
a subsequent call from the application program to BIO_write(3)
because subroutines of that function assume that the function
pointers are either NULL or valid.
Fix this by using the less error-prone calloc(3) idiom.
While here, inline asn1_bio_init() at the only call site
in asn1_bio_new() to simplify the code and make it easier to read.
Bug found and initial patch by me,
this version (with inlining) by and OK tb@.
Diffstat (limited to 'src/lib/libcrypto/man/BIO_new.3')
0 files changed, 0 insertions, 0 deletions