summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Tarasikov <alexander.tarasikov@gmail.com>2012-08-23 01:30:06 +0400
committerAlexander Tarasikov <alexander.tarasikov@gmail.com>2012-08-23 01:30:06 +0400
commit706a34a8643739b34f589a67dd1ec5baa24172ef (patch)
tree1ab59bf65ec48ff92770e6360f30748d517d2f53
parent6e6ad0dd8a929d6816284dccce13898c4a30fbe5 (diff)
downloadhardware_ril_samsung-ril-706a34a8643739b34f589a67dd1ec5baa24172ef.zip
hardware_ril_samsung-ril-706a34a8643739b34f589a67dd1ec5baa24172ef.tar.gz
hardware_ril_samsung-ril-706a34a8643739b34f589a67dd1ec5baa24172ef.tar.bz2
Add a pointer check to ipc_net_plmn_sel
-rw-r--r--net.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/net.c b/net.c
index 83ea129..24b27e3 100644
--- a/net.c
+++ b/net.c
@@ -795,10 +795,19 @@ void ril_request_query_network_selection_mode(RIL_Token t)
void ipc_net_plmn_sel(struct ipc_message_info *info)
{
- struct ipc_net_plmn_sel_get *plmn_sel = (struct ipc_net_plmn_sel_get *) info->data;
- int ril_mode = ipc2ril_plmn_sel(plmn_sel->plmn_sel);
+ struct ipc_net_plmn_sel_get *plmn_sel;
+ int ril_mode;
- RIL_onRequestComplete(reqGetToken(info->aseq), RIL_E_SUCCESS, &ril_mode, sizeof(int));
+ if (!info)
+ return;
+
+ if (!info->data || info->length < sizeof(struct ipc_net_plmn_sel_get))
+ return;
+
+ plmn_sel = (struct ipc_net_plmn_sel_get *) info->data;
+ ril_mode = ipc2ril_plmn_sel(plmn_sel->plmn_sel);
+ RIL_onRequestComplete(reqGetToken(info->aseq),
+ RIL_E_SUCCESS, &ril_mode, sizeof(int));
}
void ipc_net_plmn_sel_complete(struct ipc_message_info *info)