[Asterisk-code-review] dns: Fix pointer increment in dns parse answer ex (asterisk[master])

Joshua Colp asteriskteam at digium.com
Tue Nov 17 06:43:31 CST 2015


Joshua Colp has submitted this change and it was merged.

Change subject: dns: Fix pointer increment in dns_parse_answer_ex
......................................................................


dns: Fix pointer increment in dns_parse_answer_ex

When dns_parse_answer_ex was iterating over the answers it
wasn't incrementing the answer pointer correctly after the first
answer.  The result was that no answers after the first
were being returned.  For results where multiple records should
have been sorted by priority, weight, etc., there was nothing
to sort so the only the first record was returned even if it
wouldn't have been the correct record based on the sort.

ASTERISK-25565 #close
Reported-by: Daniel Tryba
Tested-by George Joseph

Change-Id: I8622604fefdcd3c11e2c5609a6382e53b1467b0b
---
M main/dns.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Anonymous Coward #1000019: Verified
  Ashley Sanders: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved



diff --git a/main/dns.c b/main/dns.c
index c3b352d..e338d76 100644
--- a/main/dns.c
+++ b/main/dns.c
@@ -482,7 +482,7 @@
 
 		/* Try and update the field to the next record, but ignore any errors that come
 		 * back because this may be the end of the line. */
-		pos = dns_advance_field(&answer, pos, res + ntohs(ans->size));
+		pos = dns_advance_field(&answer, pos, ntohs(ans->size));
 	}
 
 	return ret;

-- 
To view, visit https://gerrit.asterisk.org/1642
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8622604fefdcd3c11e2c5609a6382e53b1467b0b
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: George Joseph <george.joseph at fairview5.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Ashley Sanders <asanders at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>



More information about the asterisk-code-review mailing list