mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-16 21:28:33 +03:00
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
This commit is contained in:
@@ -593,6 +593,7 @@ static void dispatch_usb_command(struct msgb *msg, struct cardem_inst *ci)
|
||||
usb_buf_free(msg);
|
||||
return;
|
||||
}
|
||||
msg->l2h = msg->l1h + sizeof(*sh);
|
||||
|
||||
switch (sh->msg_class) {
|
||||
case SIMTRACE_MSGC_GENERIC:
|
||||
@@ -604,7 +605,6 @@ static void dispatch_usb_command(struct msgb *msg, struct cardem_inst *ci)
|
||||
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:
|
||||
|
||||
Reference in New Issue
Block a user