Better handling of verify param id peername field
authorViktor Dukhovni <openssl-users@dukhovni.org>
Wed, 2 Sep 2015 01:47:12 +0000 (21:47 -0400)
committerViktor Dukhovni <openssl-users@dukhovni.org>
Wed, 2 Sep 2015 14:01:23 +0000 (10:01 -0400)
commit39c76ceb2d3e51eaff95e04d6e4448f685718f8d
tree67df0e9adf128c03c760bb0b60e9604fc540dfde
parent0a1682d8b53a61732877edf015438ecd7965bc21
Better handling of verify param id peername field

Initialize pointers in param id by the book (explicit NULL assignment,
rather than just memset 0).

In x509_verify_param_zero() set peername to NULL after freeing it.

In x509_vfy.c's internal check_hosts(), avoid potential leak of
possibly already non-NULL peername.  This is only set when a check
succeeds, so don't need to do this repeatedly in the loop.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit a0724ef1c9b9e2090bdd96b784f492b6a3952957)
crypto/x509/x509_vfy.c
crypto/x509/x509_vpm.c