From: Christian Grothoff Date: Wed, 21 Jul 2010 08:05:57 +0000 (+0000) Subject: check and handle X-Git-Tag: initial-import-from-subversion-38251~20876 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2ce3fe43765aa23863954bf9667dc896c7205531;p=oweals%2Fgnunet.git check and handle --- diff --git a/src/util/server_mst.c b/src/util/server_mst.c index 0856ba576..835d8eeba 100644 --- a/src/util/server_mst.c +++ b/src/util/server_mst.c @@ -251,6 +251,12 @@ GNUNET_SERVER_mst_receive (struct GNUNET_SERVER_MessageStreamTokenizer *mst, /* can try to do zero-copy and process directly from original buffer */ hdr = (const struct GNUNET_MessageHeader *) buf; want = ntohs (hdr->size); + if (want < sizeof (struct GNUNET_MessageHeader)) + { + GNUNET_break_op (0); + mst->off = 0; + return GNUNET_SYSERR; + } if (size < want) break; /* or not, buffer incomplete, so copy to private buffer... */ if (one_shot == GNUNET_SYSERR)