Changeset 4283 for pjproject


Ignore:
Timestamp:
Oct 12, 2012 6:19:32 AM (12 years ago)
Author:
ming
Message:

Re #1559: Fixed potential buffer overflow when duplicating the string

Location:
pjproject/trunk/pjmedia/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia-audiodev/alsa_dev.c

    r4130 r4283  
    233233 
    234234    /* Set device name */ 
    235     strcpy(adi->name, dev_name); 
     235    strncpy(adi->name, dev_name, sizeof(adi->name)); 
    236236 
    237237    /* Check the number of playback channels */ 
  • pjproject/trunk/pjmedia/src/pjmedia/rtcp.c

    r3999 r4283  
    753753    /* Check and get BYE reason */ 
    754754    if (size > 8) { 
    755         reason.slen = *((pj_uint8_t*)pkt+8); 
     755        reason.slen = PJ_MIN(sizeof(sess->stat.peer_sdes_buf_), 
     756                             *((pj_uint8_t*)pkt+8)); 
    756757        pj_memcpy(sess->stat.peer_sdes_buf_, ((pj_uint8_t*)pkt+9), 
    757758                  reason.slen); 
Note: See TracChangeset for help on using the changeset viewer.