diff options
author | Ben Chan <benchan@chromium.org> | 2014-01-02 15:56:33 -0800 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2014-01-03 12:20:33 +0100 |
commit | cddc4af7bd18b93214ac270295b6410db1e0749f (patch) | |
tree | 15a559b4483948c8a5c539ff7863244bdd530423 | |
parent | 52d34ce0dbe375de646fd6ae25d2d8197d24dd32 (diff) |
huawei: report an error when ^PREFMODE reports no valid values
This patch fixes mm_huawei_parse_prefmode_test to always report an error when
returning NULL, which avoid a potential crash when the caller tries to access
the error.
-rw-r--r-- | plugins/huawei/mm-modem-helpers-huawei.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/huawei/mm-modem-helpers-huawei.c b/plugins/huawei/mm-modem-helpers-huawei.c index 926ca770..07a56979 100644 --- a/plugins/huawei/mm-modem-helpers-huawei.c +++ b/plugins/huawei/mm-modem-helpers-huawei.c @@ -341,6 +341,10 @@ mm_huawei_parse_prefmode_test (const gchar *response, /* No value */ if (out->len == 0) { g_array_unref (out); + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "^PREFMODE response contains no valid values"); return NULL; } |