From: Felix Fietkau Date: Sun, 23 Jan 2011 19:32:57 +0000 (+0100) Subject: improve validation - add header length X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=5e5abe33feb21aff94b6a1bf492d9e6b2cda2d80;p=oweals%2Flibubox.git improve validation - add header length --- 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)