From: Schanzenbach, Martin Date: Sun, 24 Jun 2018 21:01:18 +0000 (+0200) Subject: fix possible buffer overrun X-Git-Tag: v0.11.0~357^2~24 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=61985ad211306f415207c044719e6313bc815281;p=oweals%2Fgnunet.git fix possible buffer overrun --- 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); {