Parcourir la 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 il y a 14 ans
Parent
commit
066608f3ff
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  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) {