Fix undefined behaviour in X509_NAME_cmp()
authorMatt Caswell <matt@openssl.org>
Wed, 16 May 2018 10:59:47 +0000 (11:59 +0100)
committerMatt Caswell <matt@openssl.org>
Mon, 21 May 2018 09:22:11 +0000 (10:22 +0100)
commit511190b691183a1fb160e7e05e2974dc73cab0c6
treed55f3c42f3b8f796f08e4dffd924e5ce553f4298
parent246bd8fd0507f4555432c148eed5a9322c113bf5
Fix undefined behaviour in X509_NAME_cmp()

If the lengths of both names is 0 then don't attempt to do a memcmp.

Issue reported by Simon Friedberger, Robert Merget and Juraj Somorovsky.

Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/6291)
crypto/x509/x509_cmp.c