summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Nisbet <nischris@gmail.com>2020-02-12 21:00:31 +1300
committerJo-Philipp Wich <jo@mein.io>2020-02-27 21:56:01 +0100
commit75e300aeec25e032a9778bea34c713969960d1f0 (patch)
tree4a94f2e8295c4783df2787ae8bfee7e2cd79805a
parent43a103ff17ee5872669f8712606578c90c14591d (diff)
downloadlibubox-75e300aeec25e032a9778bea34c713969960d1f0.tar.gz
blobmsg: fix wrong payload len passed from blobmsg_check_array
Fix incorrect use of blobmsg_len() on passed blobmsg to blobmsg_check_array_len() introduced in commit 379cd33d1992 ("fix wrong payload len passed from blobmsg_check_array") by using correct blob_len(). By using blobmsg_len() a value too small was passed to blobmsg_check_array() which could lead to this function returning an error when there is none. Fixes: 379cd33d1992 ("fix wrong payload len passed from blobmsg_check_array") Signed-off-by: Chris Nisbet <nischris@gmail.com> [add fixes tag, rewrap commit message] Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--blobmsg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/blobmsg.c b/blobmsg.c
index 7620784..8b9877d 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, blobmsg_len(attr));
+ return blobmsg_check_array_len(attr, type, blob_len(attr));
}
int blobmsg_check_array_len(const struct blob_attr *attr, int type, size_t len)