summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Kim <jeik01.kim@samsung.com>2020-11-11 20:12:49 +0900
committerJaehyun Kim <jeik01.kim@samsung.com>2020-12-17 11:16:56 +0900
commit72d6b309ae91ca2b29f2f239046342c664165f79 (patch)
treee3dbe0d08ede32fe1a5d73947c3f8d610bdab668
parent4e1d941e94590b2a41996b477f2563a9c860e1e5 (diff)
downloadconnman-72d6b309ae91ca2b29f2f239046342c664165f79.tar.gz
connman-72d6b309ae91ca2b29f2f239046342c664165f79.tar.bz2
connman-72d6b309ae91ca2b29f2f239046342c664165f79.zip
Fix derefrencing of NULL pointer
In some cases network->device could be NULL which leads to crash Change-Id: I14210822179f0d8ecbc8bcd046700d1118409cbd Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
-rwxr-xr-xsrc/service.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/service.c b/src/service.c
index 90ff7e5e..6c4dbd1c 100755
--- a/src/service.c
+++ b/src/service.c
@@ -7618,6 +7618,9 @@ static int calculate_score_last_user_selection(struct connman_service *service)
struct tm* ref_timeinfo;
device = connman_network_get_device(service->network);
+ if (!device)
+ return 0;
+
last_user_selection_time = connman_device_get_last_user_selection_time(device);
last_user_selection_ident = connman_device_get_last_user_selection_ident(device);
frequency = connman_network_get_frequency(service->network);