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.
This commit is contained in:
Ben Chan
2017-08-11 14:19:35 -07:00
committed by Dan Williams
parent c02dcd397a
commit 2b08a66645

View File

@@ -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);
}
/**