Changeset 5115


Ignore:
Timestamp:
Jun 22, 2015 8:49:34 AM (9 years ago)
Author:
ming
Message:

Re #1843 (misc): Fixed potential memory corruption problem if DNS resolver receives a response with more than 8 A records.

Thank you to Oleg Grazhdan for the patch and Andrey Kovalenko for the report

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib-util/src/pjlib-util/srv_resolver.c

    r4971 r5115  
    330330         */ 
    331331        for (j=0; j<query_job->srv_cnt; ++j) { 
    332             if (pj_stricmp(&rr->name, &query_job->srv[j].target_name)==0) { 
     332            if (pj_stricmp(&rr->name, &query_job->srv[j].target_name)==0 && 
     333                query_job->srv[j].addr_cnt < ADDR_MAX_COUNT) 
     334            { 
    333335                unsigned cnt = query_job->srv[j].addr_cnt; 
    334336                query_job->srv[j].addr[cnt].s_addr = rr->rdata.a.ip_addr.s_addr; 
Note: See TracChangeset for help on using the changeset viewer.