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 8cb86d947c)
This commit is contained in:
Thomas Haller 2017-11-15 18:10:31 +01:00
parent 18e8f99eb3
commit ee77657727

View file

@ -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++) {