Menu

#185 Error in TimerDemo.c

v1.0 (example)
closed-fixed
nobody
None
5
2018-12-16
2018-12-16
John Doe
No

https://sourceforge.net/p/freertos/code/HEAD/tree/tags/V10.1.1/FreeRTOS/Demo/Common/Minimal/TimerDemo.c#l1007

Shouldn't "<=" be replaced with "<", otherwise we may get off-by-one-error if uxTimerID is equal to configTIMER_QUEUE_LENGTH + 1.

(Found with PVS-Studio Static Code Analyzer.)

Discussion

  • Richard Barry

    Richard Barry - 2018-12-16
    • status: open --> closed-fixed
     
  • Richard Barry

    Richard Barry - 2018-12-16

    Thanks for taking the time to point this out. This is test code, rather than part of the kernel's implementation, so especially interested in anything you find in the kernel itself (we use a couple of static checkers ourselves, but the more the better). I've fixed this, but not tested yet, so the fix is not checked in.

     

Log in to post a comment.

MongoDB Logo MongoDB