]> git.meshlink.io Git - meshlink/commitdiff
Fix a NULL pointer dereference when unable to bind to NETLINK_ROUTE socket.
authorGuus Sliepen <guus@meshlink.io>
Thu, 28 Jan 2021 21:23:38 +0000 (22:23 +0100)
committerGuus Sliepen <guus@meshlink.io>
Thu, 28 Jan 2021 21:23:38 +0000 (22:23 +0100)
src/net.c

index 8bec6b67f52af5e52c671d94cc26ffad425244aa..1df3d8c0a187e0c8b665fd56d45462b24554872f 100644 (file)
--- 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
+               });
+       }
 }
 
 /*