[tls] Ensure received data list is initialised before calling tls_free()
authorMichael Brown <mcb30@ipxe.org>
Fri, 23 Mar 2018 11:07:29 +0000 (11:07 +0000)
committerMichael Brown <mcb30@ipxe.org>
Fri, 23 Mar 2018 11:07:29 +0000 (11:07 +0000)
commitac4fbd47aea136185e17975bd68c268bf0cc081e
tree8ea416300c55842cb0fa4b43ea34743b99fb6be5
parenteda9f4db612401e3c7e700d00336cc293376ab56
[tls] Ensure received data list is initialised before calling tls_free()

A failure in tls_generate_random() will result in a call to ref_put()
before the received data list has been initialised, which will cause
free_tls() to attempt to traverse an uninitialised list.

Fix by ensuring that all fields referenced by free_tls() are
initialised before any of the potential failure paths.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/net/tls.c