libubus: check for non-NULL data before running callbacks
authorFelix Fietkau <nbd@nbd.name>
Wed, 25 Jul 2018 08:37:30 +0000 (10:37 +0200)
committerFelix Fietkau <nbd@nbd.name>
Wed, 25 Jul 2018 08:45:34 +0000 (10:45 +0200)
commit884be451622d21fe3a7b06cc5b9d245bc4fffbf2
treeba4f657cc211f845e2c8a1ac539781cf53c8738c
parent5bae22eb5472c9c7cc30caa9a84004bba19940d3
libubus: check for non-NULL data before running callbacks

UBUS_MSG_INVOKE and UBUS_MSG_DATA can be sent without UBUS_ATTR_DATA
present. Most ubus users assume that the msg argument passed can never
be NULL, so this change prevents a crash

Signed-off-by: Felix Fietkau <nbd@nbd.name>
libubus-obj.c
libubus-req.c