[svn-commits] mjordan: trunk r394305 - /trunk/main/dns.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sat Jul 13 21:05:06 CDT 2013


Author: mjordan
Date: Sat Jul 13 21:05:04 2013
New Revision: 394305

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=394305
Log:
Remove redundant code in dns.c

Peter J Philipp pointed out that there are two checks that ensure that len is
not less than 0. If len is less than 0, the function returns. Having both of
them is clearly redundant.

This removes the second and attempts to clarify (slightly) the error condition.

(closes issue ASTERISK-21772)
Reported by: Peter J Philipp

Modified:
    trunk/main/dns.c

Modified: trunk/main/dns.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/dns.c?view=diff&rev=394305&r1=394304&r2=394305
==============================================================================
--- trunk/main/dns.c (original)
+++ trunk/main/dns.c Sat Jul 13 21:05:04 2013
@@ -225,11 +225,7 @@
 		answer += sizeof(struct dn_answer);
 		len -= sizeof(struct dn_answer);
 		if (len < 0) {
-			ast_log(LOG_WARNING, "Strange result size\n");
-			return -1;
-		}
-		if (len < 0) {
-			ast_log(LOG_WARNING, "Length exceeds frame\n");
+			ast_log(LOG_WARNING, "Length of DNS answer exceeds frame\n");
 			return -1;
 		}
 




More information about the svn-commits mailing list