Replace use of blobmsg_check_attr by blobmsg_check_attr_len

blobmsg_check_attr_len adds a length limit specifying the max offset
from attr that can be read safely.

Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
[rebased and reworked, line wrapped commit message, _safe -> _len]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
This commit is contained in:
Tobias Schramm 2018-11-13 04:16:12 +01:00 committed by Petr Štetiar
parent 143303149c
commit cd3059796a
2 changed files with 48 additions and 14 deletions

View file

@ -107,6 +107,8 @@ static inline size_t blobmsg_len(const struct blob_attr *attr)
bool blobmsg_check_attr(const struct blob_attr *attr, bool name);
bool blobmsg_check_attr_list(const struct blob_attr *attr, int type);
bool blobmsg_check_attr_len(const struct blob_attr *attr, bool name, size_t len);
/*
* blobmsg_check_array: validate array/table and return size
*