Menu

#166 Bug in trdp_pdReceive for "if data has changed"

1.4.0.0
closed
1671 (1)
2017-11-09
2017-07-24
No

In src/common/trdp_pdcom.c there is a bug in function trdp_pdReceive. Namely the line

informUser = memcmp(appHandle->pNewFrame->data,
pExistingElement->pFrame->data,
pExistingElement->dataSize);
should be:

informUser = memcmp(appHandle->pNewFrame->data,
pExistingElement->pFrame->data,
pExistingElement->dataSize) == 0 ? FALSE : TRUE;

Because TRUE is "1" and memcmp will not necessarily return 1 in the case it is not false. See memcmp documentation

Discussion

  • Bernd Löhr

    Bernd Löhr - 2017-07-24
    • status: unread --> accepted
    • assigned_to: Bernd Löhr
    • Milestone: 1.3.3.0 --> 1.4.0.0
     
  • Bernd Löhr

    Bernd Löhr - 2017-07-24

    Yep, unfortunately too late for 1.3.3. Will be fixed in trunk...

     
  • Armin-Hagen Weiss

    • labels: --> 1671
     
  • Armin-Hagen Weiss

    • status: accepted --> pending
     
  • Bernd Löhr

    Bernd Löhr - 2017-11-09
    • status: pending --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB