From ee7765772787beca2ee5bbe120f1b74f42a2aa5c Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 15 Nov 2017 18:10:31 +0100 Subject: [PATCH] clients: avoid crash in _complete_fcn_connection_master() Found by coverity, but not a practical issue, because we wouldn't actually call the function with text NULL. (cherry picked from commit 8cb86d947c3f580131337bddcbe0197584ed7a52) --- clients/common/nm-meta-setting-desc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c index 1ed6b433d8..9d2e1e238d 100644 --- a/clients/common/nm-meta-setting-desc.c +++ b/clients/common/nm-meta-setting-desc.c @@ -2448,7 +2448,7 @@ _complete_fcn_connection_master (ARGS_COMPLETE_FCN) expected_type = nm_setting_connection_get_slave_type (s_con); } - text_len = strlen (text); + text_len = text ? strlen (text) : 0; result = g_new (char *, (2 * len) + 1); for (i = 0, j = 0; i < len; i++) {