diff options
author | Ben Chan <benchan@chromium.org> | 2017-08-11 14:19:35 -0700 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2017-08-11 17:09:15 -0500 |
commit | 2b08a66645740df2e1e490df5ec44a7b5c537cc5 (patch) | |
tree | 77793e98d88e690969ccef128011d7fcc1012582 /libmm-glib/mm-cdma-manual-activation-properties.c | |
parent | c02dcd397ab6ccbc3c021bf6d96d76de7bce8b91 (diff) |
libmm-glib,cdma: fix potential NULL dereference
This patch fixes a potential NULL referenece issue in
mm_cdma_manual_activation_properties_get_prl() where it accesses
`self->priv->prl->data' when `self->priv->prl' could be potentially
NULL.
Diffstat (limited to 'libmm-glib/mm-cdma-manual-activation-properties.c')
-rw-r--r-- | libmm-glib/mm-cdma-manual-activation-properties.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libmm-glib/mm-cdma-manual-activation-properties.c b/libmm-glib/mm-cdma-manual-activation-properties.c index 7d017c4a..5e7f3c28 100644 --- a/libmm-glib/mm-cdma-manual-activation-properties.c +++ b/libmm-glib/mm-cdma-manual-activation-properties.c @@ -407,10 +407,11 @@ mm_cdma_manual_activation_properties_get_prl (MMCdmaManualActivationProperties * gsize *prl_len) { g_return_val_if_fail (MM_IS_CDMA_MANUAL_ACTIVATION_PROPERTIES (self), NULL); - if (self->priv->prl && prl_len) - *prl_len = self->priv->prl->len; - return self->priv->prl->data; + if (prl_len) + *prl_len = (self->priv->prl ? self->priv->prl->len : 0); + + return (self->priv->prl ? self->priv->prl->data : NULL); } /** |