blobmsg: accept NULL attr in blobmsg_get_string()
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
This commit is contained in:
parent
6e8e6aca1d
commit
042f1a2546
1 changed files with 3 additions and 0 deletions
|
@ -214,6 +214,9 @@ static inline uint64_t blobmsg_get_u64(struct blob_attr *attr)
|
||||||
|
|
||||||
static inline char *blobmsg_get_string(struct blob_attr *attr)
|
static inline char *blobmsg_get_string(struct blob_attr *attr)
|
||||||
{
|
{
|
||||||
|
if (!attr)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
return (char *) blobmsg_data(attr);
|
return (char *) blobmsg_data(attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue