From 40249265ab1114a37b87b2949c8fa1f76e7c0cb8 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Thu, 28 Jan 2021 22:23:38 +0100 Subject: [PATCH] Fix a NULL pointer dereference when unable to bind to NETLINK_ROUTE socket. --- src/net.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/net.c b/src/net.c index 8bec6b67..1df3d8c0 100644 --- a/src/net.c +++ b/src/net.c @@ -713,9 +713,11 @@ void retry(meshlink_handle_t *mesh) { } /* Kick the ping timeout handler */ - timeout_set(&mesh->loop, &mesh->pingtimer, &(struct timespec) { - 0, 0 - }); + if(mesh->pingtimer.cb) { + timeout_set(&mesh->loop, &mesh->pingtimer, &(struct timespec) { + 0, 0 + }); + } } /* -- 2.39.5