From: Guus Sliepen Date: Thu, 28 Jan 2021 21:23:38 +0000 (+0100) Subject: Fix a NULL pointer dereference when unable to bind to NETLINK_ROUTE socket. X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=40249265ab1114a37b87b2949c8fa1f76e7c0cb8;p=meshlink Fix a NULL pointer dereference when unable to bind to NETLINK_ROUTE socket. --- 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 + }); + } } /*