Code correction from pjphilipp

in trunk/main/dns.c, there is two subsequent if (len < 0)'s the latter will always be false and is a useless statement. I have made a small patch for you, hope this is the right place for it.

jupiter$ diff -u dns.c.orig dns.c
ā€” dns.c.orig Tue May 7 17:07:15 2013
+++ dns.c Tue May 7 17:07:53 2013
@@ -221,13 +221,13 @@
}
answer += res;
len -= res;

  •           ans = (struct dn_answer *)answer;
    
  •           answer += sizeof(struct dn_answer);
    
  •           len -= sizeof(struct dn_answer);
              if (len < 0) {
                      ast_log(LOG_WARNING, "Strange result size\n");
                      return -1;
              }
    
  •           ans = (struct dn_answer *)answer;
    
  •           answer += sizeof(struct dn_answer);
    
  •           len -= sizeof(struct dn_answer);
              if (len < 0) {
                      ast_log(LOG_WARNING, "Length exceeds frame\n");
                      return -1;

Patches posted here have to be ignored because there is no copyright licence traceability.

To submit a patch, you need to go to issues.asterisk.org/jira/
create an account, submit the licence grant form, and then raise a bug report, with the patch as attachment, and marked as a code or documentation contribution.

You should identify the version against which you made the patch.