From 77dfea9cdda9f177e03524bbc76aa8090ceb2018 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 6 Aug 2022 18:52:49 +0200 Subject: [PATCH] gluon-mesh-vpn-fastd: fix respondd segfault under load When running "fastd -v" fails, line may be NULL, causing a segfault in strncmp. (cherry picked from commit 8dd0f32c187ec62101892080785815ca3bee768b) --- 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);