From f4d2e30525055591d0f3bddd99936be4a5e3d444 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 19 Jan 2010 12:27:54 -0800 Subject: [PATCH] huawei-cdma: robustify SYSINFO parsing Shouldn't happen since the number of matches was already verified, but doesn't hurt to make sure we don't pass NULL to strtol(). --- plugins/mm-modem-huawei-cdma.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/mm-modem-huawei-cdma.c b/plugins/mm-modem-huawei-cdma.c index 72447719..3b63a486 100644 --- a/plugins/mm-modem-huawei-cdma.c +++ b/plugins/mm-modem-huawei-cdma.c @@ -129,6 +129,8 @@ uint_from_match_item (GMatchInfo *match_info, guint32 num, guint32 *val) gboolean success = FALSE; str = g_match_info_fetch (match_info, num); + g_return_val_if_fail (str != NULL, FALSE); + errno = 0; tmp = strtol (str, NULL, 10); if (errno == 0 && tmp >= 0 && tmp <= G_MAXUINT) {