Ignore:
Timestamp:
Aug 2, 2017 10:44:10 AM (7 years ago)
Author:
riza
Message:

Fix #2035: Make sure transport SRTP buf size is sufficient before calling
srtp_protect() and srtp_protect_rtcp().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/transport_srtp.c

    r5635 r5639  
    6969 
    7070#define DEACTIVATE_MEDIA(pool, m)   pjmedia_sdp_media_deactivate(pool, m) 
     71 
     72#ifdef SRTP_MAX_TRAILER_LEN 
     73#   define MAX_TRAILER_LEN SRTP_MAX_TRAILER_LEN 
     74#else 
     75#   define MAX_TRAILER_LEN 10 
     76#endif 
    7177 
    7278static const pj_str_t ID_RTP_AVP  = { "RTP/AVP", 7 }; 
     
    10631069        return pjmedia_transport_send_rtp(srtp->member_tp, pkt, size); 
    10641070 
    1065     if (size > sizeof(srtp->rtp_tx_buffer) - 10) 
     1071    if (size > sizeof(srtp->rtp_tx_buffer) - MAX_TRAILER_LEN) 
    10661072        return PJ_ETOOBIG; 
    10671073 
     
    11091115    } 
    11101116 
    1111     if (size > sizeof(srtp->rtcp_tx_buffer) - 10) 
     1117    if (size > sizeof(srtp->rtcp_tx_buffer) - MAX_TRAILER_LEN) 
    11121118        return PJ_ETOOBIG; 
    11131119 
Note: See TracChangeset for help on using the changeset viewer.