Browse Source

BugFix: Fix issue #670, Contributed by Enna1

Nick Peng 5 years ago
parent
commit
4e5248ebf3
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/dns.c

+ 1 - 1
src/dns.c

@@ -1363,7 +1363,7 @@ static int _dns_decode_opt_ecs(struct dns_context *context, struct dns_opt_ecs *
 	len = (ecs->source_prefix / 8);
 	len += (ecs->source_prefix % 8 > 0) ? 1 : 0;
 
-	if (_dns_left_len(context) < len) {
+	if (_dns_left_len(context) < len || len > sizeof(ecs->addr)) {
 		return -1;
 	}