Kaynağa Gözat

BugFix: Fix issue #670, Contributed by Enna1

Nick Peng 5 yıl önce
ebeveyn
işleme
4e5248ebf3
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  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);
 	len += (ecs->source_prefix % 8 > 0) ? 1 : 0;
 	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;
 		return -1;
 	}
 	}