Changeset 5565


Ignore:
Timestamp:
Mar 9, 2017 3:36:10 AM (8 years ago)
Author:
riza
Message:

Re #1994 (misc): Prevent crash on pj_ssl_get_info() triggered by an error on ioqueue_on_read_complete().
Thanks to Alexander Traud for the report and suggested fix.

File:
1 edited

Legend:

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

    r5544 r5565  
    145145    SSL_STATE_NULL, 
    146146    SSL_STATE_HANDSHAKING, 
    147     SSL_STATE_ESTABLISHED 
     147    SSL_STATE_ESTABLISHED, 
     148    SSL_STATE_ERROR 
    148149}; 
    149150 
     
    19071908                        buf->len += size_; 
    19081909                 
     1910                    if (status != PJ_SUCCESS) { 
     1911                        ssock->ssl_state = SSL_STATE_ERROR; 
     1912                    } 
     1913 
    19091914                    ret = (*ssock->param.cb.on_data_read)(ssock, buf->data, 
    19101915                                                          buf->len, status, 
     
    26582663        /* Current cipher */ 
    26592664        cipher = SSL_get_current_cipher(ssock->ossl_ssl); 
    2660         info->cipher = (SSL_CIPHER_get_id(cipher) & 0x00FFFFFF); 
     2665        if (cipher) { 
     2666            info->cipher = (SSL_CIPHER_get_id(cipher) & 0x00FFFFFF); 
     2667        } else { 
     2668            info->cipher = PJ_TLS_UNKNOWN_CIPHER; 
     2669        } 
    26612670 
    26622671        /* Remote address */ 
Note: See TracChangeset for help on using the changeset viewer.