libubox: Parsing empty blob messages return an error
Username: Alban Bedel
Origin: https://bugs.openwrt.org/index.php?do=details&task_id=1970
Since commit c83a84afbef (fix segfault when passed blobmsg attr is NULL) parsing an empty message, like when “{}” is passed as argument to ubus call
, return an error, it was working just fine before this commit.
This mean that ubus methods with only optional arguments need to check that blob_len() doesn’t return 0, which is annoying and might break various existing programs. At the very least blobmsg_parse() shouldn’t error out when the blob length is 0, but it might also make sense to accept a NULL message as well, just don’t segfault.