x509/x509name.c: fix potential crash in X509_NAME_get_text_by_OBJ.
authorAndy Polyakov <appro@openssl.org>
Sun, 5 Aug 2018 09:51:37 +0000 (11:51 +0200)
committerAndy Polyakov <appro@openssl.org>
Tue, 7 Aug 2018 06:56:17 +0000 (08:56 +0200)
commit28ad73181aeb3b0b027d53d3266159f4b2e15d5b
treef68342297aa398ae53af26457fe4b60c99dc4e70
parentf44d7e8b472dfc0602f8d06ef72e808a5e8d410c
x509/x509name.c: fix potential crash in X509_NAME_get_text_by_OBJ.

Documentation says "at most B<len> bytes will be written", which
formally doesn't prohibit zero. But if zero B<len> was passed, the
call to memcpy was bound to crash.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6860)
crypto/x509/x509name.c