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:28:02 +0000 (10:28 +0100)
commitbbe75a29dfdb6561f21b7d010ac18c52da4beb78
tree88eca52b4b2c94ee6ff06529c449dca0e00e0ef4
parent12843c7307900e124ee0407535cab5534fc27dad
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)

(cherry picked from commit 511190b691183a1fb160e7e05e2974dc73cab0c6)
crypto/x509/x509_cmp.c