Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wolfssl: plug memory leak in wolfssl_connect_step2() #13272

Closed
wants to merge 1 commit into from

Conversation

fabiankeil
Copy link
Contributor

Fixes:

 test 2034...[simple HTTPS GET with DER public key pinning]
 ==61829== 22,610 (3,744 direct, 18,866 indirect) bytes in 1 blocks are definitely lost in loss record 51 of 54
 ==61829==    at 0x484BB74: malloc (vg_replace_malloc.c:446)
 ==61829==    by 0x4B53A80: wolfSSL_Malloc (memory.c:344)
 ==61829==    by 0x4C1C8E1: wolfSSL_X509_new (x509.c:5326)
 ==61829==    by 0x4C3977D: d2i_X509orX509REQ (x509.c:3628)
 ==61829==    by 0x4C1D1F4: wolfSSL_X509_d2i (x509.c:3664)
 ==61829==    by 0x4C1C37B: wolfSSL_X509_dup (x509.c:13425)
 ==61829==    by 0x4C197DB: wolfSSL_get_peer_certificate (ssl.c:18765)
 ==61829==    by 0x33297C: wolfssl_connect_step2 (wolfssl.c:875)
 ==61829==    by 0x331669: wolfssl_connect_common (wolfssl.c:1287)
 ==61829==    by 0x3303E9: wolfssl_connect_nonblocking (wolfssl.c:1319)
 ==61829==    by 0x32FE89: ssl_connect_nonblocking (vtls.c:510)
 ==61829==    by 0x32DBE5: ssl_cf_connect (vtls.c:1679)
 ==61829==    by 0x27ABD7: Curl_conn_cf_connect (cfilters.c:307)
 ==61829==    by 0x27D9CF: cf_setup_connect (connect.c:1199)
 ==61829==    by 0x27ABD7: Curl_conn_cf_connect (cfilters.c:307)
 ==61829==    by 0x283CEA: cf_hc_baller_connect (cf-https-connect.c:135)

Fixes:

     test 2034...[simple HTTPS GET with DER public key pinning]
     ==61829== 22,610 (3,744 direct, 18,866 indirect) bytes in 1 blocks are definitely lost in loss record 51 of 54
     ==61829==    at 0x484BB74: malloc (vg_replace_malloc.c:446)
     ==61829==    by 0x4B53A80: wolfSSL_Malloc (memory.c:344)
     ==61829==    by 0x4C1C8E1: wolfSSL_X509_new (x509.c:5326)
     ==61829==    by 0x4C3977D: d2i_X509orX509REQ (x509.c:3628)
     ==61829==    by 0x4C1D1F4: wolfSSL_X509_d2i (x509.c:3664)
     ==61829==    by 0x4C1C37B: wolfSSL_X509_dup (x509.c:13425)
     ==61829==    by 0x4C197DB: wolfSSL_get_peer_certificate (ssl.c:18765)
     ==61829==    by 0x33297C: wolfssl_connect_step2 (wolfssl.c:875)
     ==61829==    by 0x331669: wolfssl_connect_common (wolfssl.c:1287)
     ==61829==    by 0x3303E9: wolfssl_connect_nonblocking (wolfssl.c:1319)
     ==61829==    by 0x32FE89: ssl_connect_nonblocking (vtls.c:510)
     ==61829==    by 0x32DBE5: ssl_cf_connect (vtls.c:1679)
     ==61829==    by 0x27ABD7: Curl_conn_cf_connect (cfilters.c:307)
     ==61829==    by 0x27D9CF: cf_setup_connect (connect.c:1199)
     ==61829==    by 0x27ABD7: Curl_conn_cf_connect (cfilters.c:307)
     ==61829==    by 0x283CEA: cf_hc_baller_connect (cf-https-connect.c:135)
Copy link
Member

@bagder bagder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also adding valgrind to the wolfSSL CI job to make sure we detect this the next time: #13274

@bagder bagder closed this in a15342d Apr 4, 2024
@bagder
Copy link
Member

bagder commented Apr 4, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

2 participants