From 1330ae5fc207ce2db4c1e0670a43f3c9e654152e Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Tue, 5 Jan 2016 12:17:54 -0800 Subject: [PATCH] [master] check ECS address length --- lib/dns/message.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/dns/message.c b/lib/dns/message.c index 2b38ff0393..68c86871cc 100644 --- a/lib/dns/message.c +++ b/lib/dns/message.c @@ -3252,6 +3252,9 @@ render_ecs(isc_buffer_t *ecsbuf, isc_buffer_t *target) { if (isc_buffer_remaininglength(ecsbuf) < addrbytes) return (DNS_R_OPTERR); + if (addrbytes > sizeof(addr)) + return (DNS_R_OPTERR); + ADD_STRING(target, ": "); memset(addr, 0, sizeof(addr)); for (i = 0; i < addrbytes; i ++)