Changeset 4954 for pjproject


Ignore:
Timestamp:
Oct 24, 2014 3:28:05 AM (10 years ago)
Author:
nanang
Message:

Fix #1800: Fixed crash in SIP resolver when DNS server return a lot of addresses (> PJSIP_MAX_RESOLVED_ADDRESSES).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip/sip_resolve.c

    r4108 r4954  
    454454    /* Build server addresses and call callback */ 
    455455    srv.count = 0; 
    456     for (i=0; i<rec.addr_count; ++i) { 
     456    for (i = 0; i < rec.addr_count && 
     457                srv.count < PJSIP_MAX_RESOLVED_ADDRESSES; ++i) 
     458    { 
    457459        srv.entry[srv.count].type = query->naptr[0].type; 
    458460        srv.entry[srv.count].priority = 0; 
     
    499501        unsigned j; 
    500502 
    501         for (j=0; j<rec->entry[i].server.addr_count; ++j) { 
     503        for (j = 0; j < rec->entry[i].server.addr_count && 
     504                    srv.count < PJSIP_MAX_RESOLVED_ADDRESSES; ++j) 
     505        { 
    502506            srv.entry[srv.count].type = query->naptr[0].type; 
    503507            srv.entry[srv.count].priority = rec->entry[i].priority; 
Note: See TracChangeset for help on using the changeset viewer.