Menu

#255 opTrnState of pTTDB isn't copied completely

1.4.2.0
closed
None
2019-06-14
2019-05-15
No

copy TRDP_OP_TRAIN_DIR_STATUS_INFO_T completely when receiving a ComId 100 PD dataset.
Within implementation of tau_tti.c following memcpy is done:
memcpy(&appHandle->pTTDB->opTrnState, &pTelegram->state,
(sizeof(TRDP_OP_TRAIN_DIR_STATE_T) < dataSize) ? sizeof(TRDP_OP_TRAIN_DIR_STATE_T) : dataSize);

Cause TRDP_OP_TRAIN_DIR_STATE_T state; is in front of TRDP_OP_TRAIN_DIR_STATUS_INFO_T opTrnState; this will be copied correctly BUT everything else is left untouched/uncopied. Therefore for example the own consist numbers won't be copied and are therefore wrong in database.

Imho the correct call would be:

memcpy(&appHandle->pTTDB->opTrnState, pTelegram,
(sizeof(TRDP_OP_TRAIN_DIR_STATUS_INFO_T) < dataSize) ? sizeof(TRDP_OP_TRAIN_DIR_STATUS_INFO_T) : dataSize);

Discussion

  • Matthias Mossner

    please see revision r1863 on branch trdp-mm-1.3.1.0 for a possible fix

     
  • Bernd Löhr

    Bernd Löhr - 2019-05-15
    • status: open --> pending
    • assigned_to: Matthias Mossner --> Bernd Löhr
     
  • Bernd Löhr

    Bernd Löhr - 2019-05-15

    Fixed, ownOpCstNo, ownTrnCstNo + safety trailer are now copied.
    However, this rises an until now hidden problem: SDT must be able to validate these packets before using the values. This can only be done on the raw packets. -> For safety related communication, the tau_tti subsystem must not de-marshall SDTv2 protected data! see Ticket #258

     
  • Bernd Löhr

    Bernd Löhr - 2019-06-14
    • Status: pending --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB