diff options
author | Florian Westphal <fw@strlen.de> | 2018-04-28 11:41:23 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2018-04-29 10:44:50 +0200 |
commit | 9974a9070c03b9ede1272c17adf5129086bf484c (patch) | |
tree | 48a287e2e9cc93aace1d97029868e2ccc814a925 | |
parent | f830fce5c95a1771ceb8c2d727a8c99c7bc64e7e (diff) |
udata: refuse to put more than UINT8_MAX bytes
->len is uint8_t, so we can't handle more than this.
Signed-off-by: Florian Westphal <fw@strlen.de>
-rw-r--r-- | src/udata.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/udata.c b/src/udata.c index 6bd9651..b5a4729 100644 --- a/src/udata.c +++ b/src/udata.c @@ -74,7 +74,7 @@ bool nftnl_udata_put(struct nftnl_udata_buf *buf, uint8_t type, uint32_t len, { struct nftnl_udata *attr; - if (buf->size < len + sizeof(struct nftnl_udata)) + if (len > UINT8_MAX || buf->size < len + sizeof(struct nftnl_udata)) return false; attr = (struct nftnl_udata *)buf->end; |