[PATCH 1/4] stemodem: Fix possible NULL dereference

Max Rudik <[email protected]>
Newsgroups dev.linux.lists.ofono
Message-ID <[email protected]>
---
 drivers/stemodem/gprs-context.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/stemodem/gprs-context.c b/drivers/stemodem/gprs-context.c
index a23c6f83..58085f5b 100644
--- a/drivers/stemodem/gprs-context.c
+++ b/drivers/stemodem/gprs-context.c
@@ -193,6 +193,10 @@ static void ste_eppsd_up_cb(gboolean ok, GAtResult *result, gpointer user_data)
 	for (i = 0; i < g_at_result_num_response_lines(result); i++) {
 		g_at_result_iter_next(&iter, NULL);
 		res_string = g_at_result_iter_raw_line(&iter);
+
+		if (res_string == NULL)
+			goto error;
+
 		length = strlen(res_string);
 
 		if (!g_markup_parse_context_parse(context, res_string,
-- 
2.34.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.