From 61985ad211306f415207c044719e6313bc815281 Mon Sep 17 00:00:00 2001 From: "Schanzenbach, Martin" Date: Sun, 24 Jun 2018 23:01:18 +0200 Subject: [PATCH] fix possible buffer overrun --- src/namecache/namecache_api.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/namecache/namecache_api.c b/src/namecache/namecache_api.c index 2bb233da1..6e4ebeae0 100644 --- a/src/namecache/namecache_api.c +++ b/src/namecache/namecache_api.c @@ -224,6 +224,12 @@ handle_lookup_block_response (void *cls, GNUNET_free (qe); return; } + if (ntohs (msg->gns_header.header.size) < sizeof (struct LookupBlockResponseMessage)) + { + LOG (GNUNET_ERROR_TYPE_ERROR, + "Message is too short\n"); + return; + } size = ntohs (msg->gns_header.header.size) - sizeof (struct LookupBlockResponseMessage); { -- 2.25.1