ERR: fix err_data_size inconsistencies
authorRichard Levitte <levitte@openssl.org>
Wed, 31 Jul 2019 07:27:05 +0000 (09:27 +0200)
committerRichard Levitte <levitte@openssl.org>
Wed, 31 Jul 2019 11:22:13 +0000 (13:22 +0200)
commit189dbdd99416a481d49a43bd7f4a8ab90bef1e85
tree8a4534da80ff59a18de141d0e7c3314cfc491cd8
parentfaa9dcd4d468441422254ab2d887bb267e0245b6
ERR: fix err_data_size inconsistencies

In ERR_add_error_vdata(), the size of err_data had 1 added to it in
some spots, which could lead to buffer overflow.

In ERR_vset_error(), ERR_MAX_DATA_SIZE was used instead of buf_size in
the BIO_vsnprintf() call, which would lead to a buffer overflow if
such a large buffer couldn't be allocated.

Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/9491)
crypto/err/err.c
crypto/err/err_blocks.c