From 042f1a2546660e8aadde2ee65f5fe7a9cc9b1378 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 3 Aug 2014 15:00:54 +0200 Subject: [PATCH] blobmsg: accept NULL attr in blobmsg_get_string() Signed-off-by: Felix Fietkau --- blobmsg.h | 3 +++ 1 file changed, 3 insertions(+) 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); }