Skip to content
Snippets Groups Projects

checkStamp: prevent array size promotion/truncation

Closed anonymouspage requested to merge anonymouspage/sbbs:checkstamp-array-parameter into master

Calls to checkStamp are passing literals that are not 20 bytes in size. This causes a "promotion" of the size in the context of checkStamp. We can quiet these warnings by just marking the parameter as a pointer.

Note: a safer approach would be to pass a pointer and length.

This was detected by gcc 11.2.0:

ooii.c:1018:9: error: 'checkStamp' accessing 20 bytes in a region of size 11 [-Werror=stringop-overflow=] ...

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading