summaryrefslogtreecommitdiff
path: root/main/dns.c
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2013-07-14 02:05:04 +0000
committerMatthew Jordan <mjordan@digium.com>2013-07-14 02:05:04 +0000
commit583226dc5e11efe441f5371807b189cf4e07784a (patch)
tree28e47b2a90a878f2ada07c6f8c5d0e873c75ea48 /main/dns.c
parenta3592db1fb558763d28878c707a9cbc16b890e21 (diff)
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 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394305 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/dns.c')
-rw-r--r--main/dns.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/main/dns.c b/main/dns.c
index c507d5a58..d5682758e 100644
--- a/main/dns.c
+++ b/main/dns.c
@@ -225,11 +225,7 @@ static int dns_parse_answer(void *context,
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;
}