commit 5ca3c4495eb4e9a1162283434ef22f6eb626831e
parent e5dedc337830b8d721c61f7e128af87b0d131f0c
Author: James Prestwood <james.prestwood@linux.intel.com>
Date: Wed, 3 Jul 2019 10:42:09 -0700
resolve: fix crash in resolve_exit
method.ops is NULL, which causes method.ops->exit to crash. This
adds a check that method.ops is not NULL before dereferencing.
Fixes:
Aborting (signal 11) [/home/jprestwo/iwd/src/iwd]
++++++++ backtrace ++++++++
0 0x7f016b59cf20 in /lib/x86_64-linux-gnu/libc.so.6
1 0x432057 in resolve_exit() at /home/jprestwo/iwd/src/resolve.c:295
2 0x403b61 in iwd_modules_exit() at /home/jprestwo/iwd/src/main.c:195
3 0x7f016b57fb97 in /lib/x86_64-linux-gnu/libc.so.6
+++++++++++++++++++++++++++
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/resolve.c b/src/resolve.c
@@ -292,7 +292,7 @@ static int resolve_init(void)
static void resolve_exit(void)
{
- if (!method.ops->exit)
+ if (!method.ops || !method.ops->exit)
return;
method.ops->exit(method.data);