[MM] [PATCH] broadband-modem: check for NULL response in parse_caps_cpin and parse_caps_cgmm



---
 src/mm-broadband-modem.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c
index 9161c82..070526f 100644
--- a/src/mm-broadband-modem.c
+++ b/src/mm-broadband-modem.c
@@ -465,6 +465,9 @@ parse_caps_cpin (MMBaseModem *self,
                  GVariant **result,
                  GError **result_error)
 {
+    if (!response)
+        return FALSE;
+
     if (strcasestr (response, "SIM PIN") ||
         strcasestr (response, "SIM PUK") ||
         strcasestr (response, "PH-SIM PIN") ||
@@ -498,6 +501,9 @@ parse_caps_cgmm (MMBaseModem *self,
                  GVariant **result,
                  GError **result_error)
 {
+    if (!response)
+        return FALSE;
+
     /* This check detects some really old Motorola GPRS dongles and phones */
     if (strstr (response, "GSM900") ||
         strstr (response, "GSM1800") ||
-- 
1.7.7.3



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]