Browse Source

Avoid theoretical NULL pointer dereference during TLS reassemble

This function does not get called with in_data == NULL in practice, but
it seems to be at least partly prepared for that case, so better make it
consistent by handling the NULL value throughout the function.
Jouni Malinen 14 years ago
parent
commit
066608f3ff
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/eap_peer/eap_tls_common.c

+ 2 - 1
src/eap_peer/eap_tls_common.c

@@ -361,7 +361,8 @@ static int eap_peer_tls_reassemble_fragment(struct eap_ssl_data *data,
 		eap_peer_tls_reset_input(data);
 		return -1;
 	}
-	wpabuf_put_buf(data->tls_in, in_data);
+	if (in_data)
+		wpabuf_put_buf(data->tls_in, in_data);
 	data->tls_in_left -= in_len;
 
 	if (data->tls_in_left > 0) {