From a2195babf2765cc21a943eea6d52a7902db37e8f Mon Sep 17 00:00:00 2001 From: Sven Schwermer Date: Tue, 28 Jun 2022 14:37:28 +0200 Subject: [PATCH] fibocom: Fix GTRNDIS parsing function This fixes a bug introduced in a2a0e2d754. Since the state pointer is always non-NULL, the function will always fail if GTRNDIS is inactive, i.e. the modem will return state=0 and no cid field. Signed-off-by: Sven Schwermer --- plugins/fibocom/mm-broadband-bearer-fibocom-ecm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/fibocom/mm-broadband-bearer-fibocom-ecm.c b/plugins/fibocom/mm-broadband-bearer-fibocom-ecm.c index a4faf6ab..6d045e1f 100644 --- a/plugins/fibocom/mm-broadband-bearer-fibocom-ecm.c +++ b/plugins/fibocom/mm-broadband-bearer-fibocom-ecm.c @@ -50,7 +50,7 @@ parse_gtrndis_read_response (const gchar *response, return FALSE; } - if (state) { + if (*state) { if (!mm_get_uint_from_match_info (match_info, 2, cid)) { g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Failed to match cid in +GTRNDIS response: %s", response);