GNUTLS: Add some more misc checks to the start of functions

This commit is contained in:
Aaron Jones 2016-09-16 23:58:57 +00:00
parent 70bb2e24e0
commit fe9fba46cf
No known key found for this signature in database
GPG key ID: EC6F86EE9CD840B5

View file

@ -208,7 +208,7 @@ rb_ssl_clear_handshake_count(rb_fde_t *const F)
} }
static void static void
rb_ssl_timeout_cb(rb_fde_t *const F, void *const notused) rb_ssl_timeout_cb(rb_fde_t *const F, void *const data)
{ {
lrb_assert(F->accept != NULL); lrb_assert(F->accept != NULL);
lrb_assert(F->accept->callback != NULL); lrb_assert(F->accept->callback != NULL);
@ -648,6 +648,8 @@ rb_ssl_connect_common(rb_fde_t *const F, void *const data)
static void static void
rb_ssl_tryconn(rb_fde_t *const F, const int status, void *const data) rb_ssl_tryconn(rb_fde_t *const F, const int status, void *const data)
{ {
lrb_assert(F != NULL);
struct ssl_connect *const sconn = data; struct ssl_connect *const sconn = data;
if(status != RB_OK) if(status != RB_OK)
@ -733,6 +735,9 @@ rb_get_ssl_strerror(rb_fde_t *const F)
int int
rb_get_ssl_certfp(rb_fde_t *const F, uint8_t certfp[const RB_SSL_CERTFP_LEN], const int method) rb_get_ssl_certfp(rb_fde_t *const F, uint8_t certfp[const RB_SSL_CERTFP_LEN], const int method)
{ {
if (F == NULL || F->ssl == NULL)
return 0;
gnutls_digest_algorithm_t md_type; gnutls_digest_algorithm_t md_type;
switch(method) switch(method)