summaryrefslogtreecommitdiffstats
path: root/meta-agl-profile-core/recipes-connectivity/neardal/neardal/0001-neardal-ncl-fix-segfault-on-help-page-being-displaye.patch
blob: 8e45e1ca2c2cc34f70cacc2348112317a4911e77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From 0f33143d13d9224ffa8b648e2d9cf11c62ba234d Mon Sep 17 00:00:00 2001
From: Matt Ranostay <matt.ranostay@konsulko.com>
Date: Fri, 6 Jul 2018 17:19:09 -0700
Subject: [PATCH] neardal: ncl: fix segfault on help page being displayed

LISTCMD_NAME is declared as a const char due to being defined in a
macro so g_strdup it to stop proceeding operations from segfaulting.

Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
---
 ncl/ncl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ncl/ncl.c b/ncl/ncl.c
index ef42862..c26e757 100644
--- a/ncl/ncl.c
+++ b/ncl/ncl.c
@@ -342,7 +342,7 @@ int main(int argc, char *argv[])
 		g_io_channel_unref(gNclCtx.channel);
 
 		if (show_help)
-			ncl_exec(LISTCMD_NAME);
+			ncl_exec(g_strdup(LISTCMD_NAME));
 
 		g_main_loop_run(gNclCtx.main_loop);
 	}
-- 
2.17.1