]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Avoid theoretical NULL pointer dereference during TLS reassemble
authorJouni Malinen <jouni.malinen@atheros.com>
Wed, 13 Apr 2011 23:45:14 +0000 (02:45 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 13 Apr 2011 23:45:14 +0000 (02:45 +0300)
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.

src/eap_peer/eap_tls_common.c

index 7bd50f677bc8fe39d69be90f689e58300b32f4db..d1567e9281da4888adb1f659502a28ec0a5b3e43 100644 (file)
@@ -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) {