Menu

#186 Potential SEGFAULT in case of PD timeout

1.4.0.0
closed
PD (2)
2018-05-03
2018-01-08
No

In the trdp_pdHandleTimeOuts() function (common/trdp_pdcom.c) the iterPD->pFrame pointer is checked against NULL value in order to avoid NULL dereferencing in the further iterPD->pfCbFunction call.

Anyway some code lines above the check (line 771), the iterPD->pFrame pointer is used 7 times to access ist frameHead subfield without any check.

As far as I can understand in case of timeout the pFrame pointer could (should?) be NULL. So dereferncing pFrame to access frameHead should not be done since leading to a SEGFAULT.

I propose the attached patch to prevent this unenviable scenario.

1 Attachments

Discussion

  • Bernd Löhr

    Bernd Löhr - 2018-01-29
    • status: unread --> pending
    • assigned_to: Bernd Löhr
     
  • Bernd Löhr

    Bernd Löhr - 2018-01-29

    You're right, but your patch missed one possible case ;-)

     
  • Bernd Löhr

    Bernd Löhr - 2018-05-03
    • status: pending --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB