Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. Read more...

Bug #894423

gcc-11: stringop-overread at edithand.c strncmp() about scenario.authors

Added by Marko Lindqvist 2 months ago. Updated 2 months ago.

Status:
Closed
Priority:
Normal
Category:
Server
Sprint/Milestone:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Compiling with gcc-11 development snapshot:

../../../src/server/edithand.c: In function 'handle_edit_game':
../../../src/server/edithand.c:1403:12: error: 'strncmp' specified bound 4096 exceeds source size 1365 [-Werror=stringop-overread]
1403 | if (0 != strncmp(packet->scenario_authors, game.scenario.authors, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1404 | MAX_LEN_PACKET)) { | ~~~~~~~~~~~~~

History

#2 Updated by Marko Lindqvist 2 months ago

- Use size of only one of game.scenario.authors and packet->scenario_authors
- Added static assert that game.scenario.authors and packet->scenario_authors are same size

#3 Updated by Marko Lindqvist 2 months ago

  • Status changed from Resolved to Closed
  • Assignee set to Marko Lindqvist

Also available in: Atom PDF