// get the size of this transcation
usbfifolen = USB_BYTE_REG_READ(ZM_EP4_BYTE_COUNT_LOW_OFFSET);
+ if (usbfifolen > 0x40) {
+ A_PRINTF("EP4 FIFO Bug? Buffer is too big: %x\n", usbfifolen);
+ goto ERR;
+ }
// check is command is new
if( cmd_is_new ){
// accumulate the size
cmdLen += usbfifolen;
+ if (cmdLen > buf->desc_list->buf_size) {
+ A_PRINTF("Data length on EP4 FIFO is bigger as allocated buffer data!"
+ " Drop it!\n");
+ goto ERR;
+ }
// round it to alignment
if(usbfifolen % 4)