diff --git a/src/datIf.cpp b/src/datIf.cpp index 8496dfa..5658fde 100644 --- a/src/datIf.cpp +++ b/src/datIf.cpp @@ -1042,9 +1042,19 @@ char T_datif::loadRecDataFromFrame() epi_setDcDataValid(); // DC-Data are valid as DC responded. // Could be set to every response but this (31) // is a very common and very important request - gpi_storeDynMachineConditions(RdDleng, receivedData); - gpi_storeDI_CoinAttach(receivedData[6]); // new, 14.2.24 needed for direct coin insertion + if (RdDleng > sizeof(struct T_dynamicCondition)) { + qCritical() << "!!!WARNING!!! RdDlen too high" << RdDleng; + // only use as many bytes as maximally possible + char buf[sizeof(struct T_dynamicCondition)]; + memset(buf, 0, sizeof(buf)); + memcpy(buf, receivedData, sizeof(struct T_dynamicCondition)); + gpi_storeDynMachineConditions(buf); + } else { + gpi_storeDynMachineConditions(receivedData); + } + + gpi_storeDI_CoinAttach(((struct T_dynamicCondition *)receivedData)->coinAttached); // new, 14.2.24 needed for direct coin insertion } /* funktioniert, ist aber nicht nötig. Signal wird nach dem shared memory erzeugt