summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2018-04-28 11:41:23 +0200
committerFlorian Westphal <fw@strlen.de>2018-04-29 10:44:50 +0200
commit9974a9070c03b9ede1272c17adf5129086bf484c (patch)
tree48a287e2e9cc93aace1d97029868e2ccc814a925 /src
parentf830fce5c95a1771ceb8c2d727a8c99c7bc64e7e (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>
Diffstat (limited to 'src')
-rw-r--r--src/udata.c2
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;