Menu

#362 trnNetDir read from wrong address in ttiStoreTrnNetDir

2.1.0.0
closed
2240 (1)
2021-08-11
2021-04-06
No

When receiving ComId 107 the funciton ttiStoreTrnNetDir is reading the trnNetDir from the wrong address (4 bytes before the actual data starts).

Current code:
/ 4 Bytes up to cstCnt plus number of Consists /
size = appHandle->pTTDB->trnNetDir.entryCnt * sizeof(TRDP_TRAIN_NET_DIR_ENTRY_T);
memcpy(&appHandle->pTTDB->trnNetDir.trnNetDir[0], pData, size);
pData += 4 + size; / jump to etbTopoCnt /

Expected code:
/ 4 Bytes up to cstCnt plus number of Consists /
size = appHandle->pTTDB->trnNetDir.entryCnt * sizeof(TRDP_TRAIN_NET_DIR_ENTRY_T);
pData += 4; / jump to trnNetDir /
memcpy(&appHandle->pTTDB->trnNetDir.trnNetDir[0], pData, size);
pData += size; / jump to etbTopoCnt /

Discussion

  • Armin-Hagen Weiss

    • labels: --> 2240
    • status: open --> pending
    • assigned_to: Iris Bosse
     
  • Armin-Hagen Weiss

    Implemented accordingly. To be tested.

     
  • Stefan Bender

    Stefan Bender - 2021-08-11
    • status: pending --> closed
     
  • Stefan Bender

    Stefan Bender - 2021-08-11

    Tested in api_test_4.c test3

     

Log in to post a comment.

MongoDB Logo MongoDB