strlen takes non NULL parameters. Found with GCC's -fanalyzer.

Signed-off-by: Rosen Penev <ros...@gmail.com>
---
 blobmsg.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/blobmsg.c b/blobmsg.c
index d87d607..bb6c469 100644
--- a/blobmsg.c
+++ b/blobmsg.c
@@ -364,6 +364,8 @@ blobmsg_add_string_buffer(struct blob_buf *buf)
        int len, attrlen;
 
        attr = blob_next(buf->head);
+       if (!attr)
+               return;
        len = strlen(blobmsg_data(attr)) + 1;
 
        attrlen = blob_raw_len(attr) + len;
-- 
2.36.1


_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to