Skip to content

_thinca.c: fix array bounds check

Kipp Cannon requested to merge (removed):thinca_arraybounds into master

Description

_thinca.c: fix array bounds check

  • a loop over triggers checks for end-of-array after checking the end-time of the trigger at that offset in the array.
  • this patch reverses the order, testing for end-of-array first so as to not access the array element when the loop reaches the end-of-array
  • the old loop termination condition was correct, it would not have produced incorrect results. the worst-case scenario would have been a transient segmentation violation bug. I'm not aware of any such failures. I noticed the bug while re-reading the code.

API Changes and Justification

Backwards Compatible Changes

  • This change does not modify any class/function/struct/type definitions in a public C header file or any Python class/function definitions
  • This change adds new classes/functions/structs/types to a public C header file or Python module

Backwards Incompatible Changes

  • This change modifies an existing class/function/struct/type definition in a public C header file or Python module
  • This change removes an existing class/function/struct/type from a public C header file or Python module

If any of the Backwards Incompatible check boxes are ticked please provide a justification why this change is necessary and why it needs to be done in a backwards incompatible way.

Review Status

not reviewed.

Merge request reports