From 5e5abe33feb21aff94b6a1bf492d9e6b2cda2d80 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 23 Jan 2011 20:32:57 +0100 Subject: [PATCH] improve validation - add header length --- blobmsg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blobmsg.c b/blobmsg.c index cc6b2f3..bddf2c8 100644 --- a/blobmsg.c +++ b/blobmsg.c @@ -26,7 +26,7 @@ bool blobmsg_check_attr(const struct blob_attr *attr, bool name) if (!hdr->namelen && name) return false; - if (hdr->namelen > blob_len(attr)) + if (hdr->namelen > blob_len(attr) - sizeof(struct blobmsg_hdr)) return false; if (hdr->name[hdr->namelen] != 0) -- 2.25.1