Skip to content
Snippets Groups Projects
Commit 6919daab authored by George Joseph's avatar George Joseph
Browse files

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
parent a1fcf6f7
No related branches found
No related tags found
No related merge requests found
......@@ -482,7 +482,7 @@ static int dns_parse_answer_ex(void *context, int rr_class, int rr_type, unsigne
/* 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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment