sim-mbim: report error if decoding EID from APDU response fails

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/510
This commit is contained in:
Aleksander Morgado
2022-02-16 21:47:26 +01:00
parent 97c50e53af
commit 6aec0a6c80

View File

@@ -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++;