core: Ensure mctp_pktbuf_alloc() initialises end-offset in-bounds

Signed-off-by: Rashmica Gupta <rashmica@linux.ibm.com>
Change-Id: I423fea60fbc5a40e66761b3a66bf9b44c3a9bc84
diff --git a/core.c b/core.c
index 4acf075..254eb25 100644
--- a/core.c
+++ b/core.c
@@ -99,6 +99,9 @@
 	size_t size;
 
 	size = binding->pkt_size + binding->pkt_header + binding->pkt_trailer;
+	if (len > size) {
+		return NULL;
+	}
 
 	/* todo: pools */
 	buf = __mctp_alloc(sizeof(*buf) + size);