diff options
author | Petr Štetiar <ynezz@true.cz> | 2019-12-16 21:52:55 +0100 |
---|---|---|
committer | Petr Štetiar <ynezz@true.cz> | 2019-12-16 23:39:16 +0100 |
commit | a995b1e68129a0bb3928625c4f5a7bcb24893d75 (patch) | |
tree | 72658aeddac516e91320bb53a6d7133033bc0a6c /libubus-internal.h | |
parent | 08f17c87a000cc74551e1539d1916c7bfd84ae68 (diff) | |
download | ubus-a995b1e68129a0bb3928625c4f5a7bcb24893d75.tar.gz |
lua: workaround false positive dereference of null pointer
scan-build from clang-9 has reported following:
ubus.c:837:16: warning: Access to field 'rnotify' results in a dereference of a null pointer (loaded from variable 'sub')
sub->rnotify = luaL_ref(L, -2);
Which is false positive as the lua_error() does a long jump and
therefore never returns and this long jump probably confuses the static
analyzer. So this patch workarounds this false positive by helping
static analyzer by using common Lua idiom which is to return
lua_error()'s return value.
Ref: https://www.lua.org/manual/5.1/manual.html#lua_error
Addresses-Coverity-ID: 1412355 ("Dereference after null check")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
Diffstat (limited to 'libubus-internal.h')
0 files changed, 0 insertions, 0 deletions