Kévin Redon has uploaded this change for review. ( 
https://gerrit.osmocom.org/10122


Change subject: cardem: fix USB message parsing
......................................................................

cardem: fix USB message parsing

the msg->l2h pointer was not set but used later on, e.g. in
dispatch_usb_command_cardem, case SIMTRACE_MSGT_DT_CEMU_SET_ATR):
>   case SIMTRACE_MSGT_DT_CEMU_SET_ATR:
>   >   atr = (struct cardemu_usb_msg_set_atr *) msg->l2h;
>   >   card_emu_set_atr(ci->ch, atr->atr, atr->atr_len);
l2h is by default 0, thus not pointing to the actual message l2h.
I wonder how cardem worked worked before with this issue though.

Change-Id: Ifbb53dbf478d8dade82251f769e78e1306e77434
---
M firmware/libcommon/source/mode_cardemu.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/22/10122/1

diff --git a/firmware/libcommon/source/mode_cardemu.c 
b/firmware/libcommon/source/mode_cardemu.c
index 7bb06f9..57d541b 100644
--- a/firmware/libcommon/source/mode_cardemu.c
+++ b/firmware/libcommon/source/mode_cardemu.c
@@ -593,6 +593,7 @@
                usb_buf_free(msg);
                return;
        }
+       msg->l2h = msg->l1h + sizeof(*sh);

        switch (sh->msg_class) {
        case SIMTRACE_MSGC_GENERIC:
@@ -604,7 +605,6 @@
        case SIMTRACE_MSGC_MODEM:
                /* FIXME: Find out why this fails if used for !=
                 * MSGC_MODEM ?!? */
-               msg->l2h = msg->l1h + sizeof(*sh);
                dispatch_usb_command_modem(msg, ci);
                break;
        default:

--
To view, visit https://gerrit.osmocom.org/10122
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifbb53dbf478d8dade82251f769e78e1306e77434
Gerrit-Change-Number: 10122
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon <kre...@sysmocom.de>

Reply via email to