summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2020-05-25 13:44:20 +0200
committerFelix Fietkau <nbd@nbd.name>2020-05-26 10:06:53 +0200
commitc2fc622b771f679e8f55060ac60cfe02b9a80995 (patch)
tree34eccc81f91b77b3a1f494232b1d3c004db38928
parentcf2e8eb485abc30ed8acc51ba5cb50d2bbc8e3d1 (diff)
downloadlibubox-c2fc622b771f679e8f55060ac60cfe02b9a80995.tar.gz
blobmsg: fix length in blobmsg_check_array
blobmsg_check_array_len expects the length of the full attribute buffer, not just the data length. Due to other missing length checks (fixed in the next commit), this did not show up as a test failure Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--blobmsg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/blobmsg.c b/blobmsg.c
index 59045e1..daaa9fc 100644
--- a/blobmsg.c
+++ b/blobmsg.c
@@ -114,7 +114,7 @@ bool blobmsg_check_attr_len(const struct blob_attr *attr, bool name, size_t len)
int blobmsg_check_array(const struct blob_attr *attr, int type)
{
- return blobmsg_check_array_len(attr, type, blob_len(attr));
+ return blobmsg_check_array_len(attr, type, blob_raw_len(attr));
}
int blobmsg_check_array_len(const struct blob_attr *attr, int type,