mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-03 04:16:43 +00:00
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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user