summaryrefslogtreecommitdiff
path: root/pjlib-util
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2008-06-12 12:36:59 +0000
committerBenny Prijono <bennylp@teluu.com>2008-06-12 12:36:59 +0000
commitf6f83a2e0b506167a560b374bcd5a781c10a7348 (patch)
tree802fbb3b08f8081d38fd689357b2393cba1e2772 /pjlib-util
parentf0897261d693c1111e6500fee4bdfb8570dbc568 (diff)
Bug in srv_resolver: host_resolved value may exceed number of SRV records if there are more than A records in Additional Record section of the response for a single SRV target (thanks Ruud Klaver)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2006 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib-util')
-rw-r--r--pjlib-util/src/pjlib-util/srv_resolver.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pjlib-util/src/pjlib-util/srv_resolver.c b/pjlib-util/src/pjlib-util/srv_resolver.c
index ca5892d8..4683357d 100644
--- a/pjlib-util/src/pjlib-util/srv_resolver.c
+++ b/pjlib-util/src/pjlib-util/srv_resolver.c
@@ -285,8 +285,10 @@ static void build_server_entries(pj_dns_srv_resolver_job *query_job,
if (pj_stricmp(&rr->name, &query_job->srv[j].target_name)==0) {
unsigned cnt = query_job->srv[j].addr_cnt;
query_job->srv[j].addr[cnt].s_addr = rr->rdata.a.ip_addr.s_addr;
+ /* Only increment host_resolved once per SRV record */
+ if (query_job->srv[j].addr_cnt == 0)
+ ++query_job->host_resolved;
++query_job->srv[j].addr_cnt;
- ++query_job->host_resolved;
break;
}
}