From 20eea9b9caec6f60a3cc331eb5c7e9421dae7245 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 9 Aug 2022 20:09:31 +0200 Subject: [PATCH] gluon-mesh-vpn-fastd: fix respondd segfault under load (#2594) When running "fastd -v" fails, line may be NULL, causing a segfault in strncmp. --- package/gluon-mesh-vpn-fastd/src/respondd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/gluon-mesh-vpn-fastd/src/respondd.c b/package/gluon-mesh-vpn-fastd/src/respondd.c index 4d4b5a37..4a321d30 100644 --- a/package/gluon-mesh-vpn-fastd/src/respondd.c +++ b/package/gluon-mesh-vpn-fastd/src/respondd.c @@ -65,7 +65,7 @@ static struct json_object * get_fastd_version(void) { } const char *version = line; - if (strncmp(version, "fastd ", 6) == 0) + if (version && strncmp(version, "fastd ", 6) == 0) version += 6; struct json_object *ret = gluonutil_wrap_string(version);