Ignore:
Timestamp:
Oct 11, 2019 2:26:12 PM (5 years ago)
Author:
riza
Message:

Fix #2244: Prevent continuous memory allocation when getting raw certificate on TLS.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/ssl_sock_imp_common.c

    r6082 r6091  
    620620 
    621621    /* Secure release pool, i.e: all memory blocks will be zeroed first */ 
     622    pj_pool_secure_release(&ssock->info_pool); 
    622623    pj_pool_secure_release(&ssock->pool); 
    623624} 
     
    12671268    pj_ssl_sock_t *ssock; 
    12681269    pj_status_t status; 
     1270    pj_pool_t *info_pool; 
    12691271 
    12701272    PJ_ASSERT_RETURN(pool && param && p_ssock, PJ_EINVAL); 
    12711273    PJ_ASSERT_RETURN(param->sock_type == pj_SOCK_STREAM(), PJ_ENOTSUP); 
    12721274 
     1275    info_pool = pj_pool_create(pool->factory, "ssl_chain%p", 512, 512, NULL); 
    12731276    pool = pj_pool_create(pool->factory, "ssl%p", 512, 512, NULL); 
    12741277 
     
    12761279    ssock = ssl_alloc(pool); 
    12771280    ssock->pool = pool; 
     1281    ssock->info_pool = info_pool; 
    12781282    ssock->sock = PJ_INVALID_SOCKET; 
    12791283    ssock->ssl_state = SSL_STATE_NULL; 
Note: See TracChangeset for help on using the changeset viewer.