From 5ca3c4495eb4e9a1162283434ef22f6eb626831e Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Wed, 3 Jul 2019 10:42:09 -0700 Subject: [PATCH] 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 +++++++++++++++++++++++++++ --- src/resolve.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resolve.c b/src/resolve.c index 21b357bb..0352fc59 100644 --- 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);