aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2022-02-16 21:47:26 +0100
committerAleksander Morgado <aleksander@aleksander.es>2022-02-16 21:48:19 +0100
commit6aec0a6c8052107e70faa3c9c5bd42dd35266604 (patch)
treee67fb78aa1d8aae5eb87073c52c6f37125cfd26c /src
parent97c50e53af3d45617d5208725b381a2b55f88136 (diff)
sim-mbim: report error if decoding EID from APDU response fails
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/510
Diffstat (limited to 'src')
-rw-r--r--src/mm-sim-mbim.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mm-sim-mbim.c b/src/mm-sim-mbim.c
index f9baafc0..b0addb2e 100644
--- a/src/mm-sim-mbim.c
+++ b/src/mm-sim-mbim.c
@@ -475,9 +475,13 @@ check_uicc_apdu_ready (MbimDevice *device,
&apdu_response,
&error))
ctx->saved_error = error;
- else
+ else {
ctx->eid = mm_decode_eid ((const gchar *)(apdu_response + EID_APDU_HEADER),
apdu_response_size - EID_APDU_HEADER);
+ if (!ctx->eid)
+ ctx->saved_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS,
+ "Invalid APDU response: unable to decode EID");
+ }
/* always go on to the close channel step, even on error */
ctx->step++;