commit | 487b31e0ad502e41fba7e57e48779a56cb9c3062 | [log] [tgz] |
---|---|---|
author | Rashmica Gupta <rashmica@linux.ibm.com> | Wed Sep 14 18:49:45 2022 +1000 |
committer | Andrew Jeffery <andrew@codeconstruct.com.au> | Tue Oct 31 23:31:39 2023 +0000 |
tree | 3629e932d3092bcd8a98efae958c5efb53c2badd | |
parent | 895083b592062ed75c3f2127191c2a1dcc3b85f8 [diff] [blame] |
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);