Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-08-03 17:00:54 +0400
committerFelix Fietkau <nbd@openwrt.org>2014-08-03 17:00:54 +0400
commit042f1a2546660e8aadde2ee65f5fe7a9cc9b1378 (patch)
tree7a39afc187fc887ff8618227070818d6e44da89a /blobmsg.h
parent6e8e6aca1d919e9916b2a1c8702d0cdec68e1ada (diff)
blobmsg: accept NULL attr in blobmsg_get_string()
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'blobmsg.h')
-rw-r--r--blobmsg.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/blobmsg.h b/blobmsg.h
index 7041aca..e58f95d 100644
--- a/blobmsg.h
+++ b/blobmsg.h
@@ -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)
{
+ if (!attr)
+ return NULL;
+
return (char *) blobmsg_data(attr);
}