Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Be even more explicit about integer range bounds.
For coverity, which continues to think we're overrunning buffers when at this point it's easy to prove we're not. Here would be the corrected coverity finding: 6. Condition packet_length <= 105 /* 1 + 32 * 2 + 24 + 16 */, taking false branch. 7. Condition packet_length > 1024, taking false branch. Now packet_length must be > 105 and <= 1024. 12. Condition len1 == packet_length - (89 /* 1 + 32 * 2 + 24 */) - 16, taking true branch. len1 must be > 0 (105 - 89 - 16) and <= 919 (1024 - 89 - 16). 14. decr: Decrementing len1. The value of len1 is now between 0 and 919 (inclusive). This is where coverity goes wrong: it thinks len1 could be up to 2147483629. 15. buffer access should be OK. Coverity thinks it's not.
- Loading branch information