altcp_tls: assert in altcp_mbedtls_bio_recv if bad state

(cherry picked from commit 3cb6ae7770)
This commit is contained in:
David Girault 2018-09-27 17:11:30 +02:00 committed by Simon Goldschmidt
parent a9a215c52e
commit 1bd34ea364

View File

@ -461,6 +461,7 @@ altcp_mbedtls_bio_recv(void *ctx, unsigned char *buf, size_t len)
return MBEDTLS_ERR_NET_INVALID_CONTEXT;
}
state = (altcp_mbedtls_state_t *)conn->state;
LWIP_ASSERT("state != NULL", state != NULL);
p = state->rx;
/* @todo: return MBEDTLS_ERR_NET_CONN_RESET/MBEDTLS_ERR_NET_RECV_FAILED? */