Ticket #43985

tilespec.c:6486:58: runtime error: index 6 out of bounds for type citizen_graphic 4

Open Date: 2022-02-26 09:08 Last Update: 2022-03-03 18:40

Reporter:
Owner:
Type:
Status:
Closed
Component:
MileStone:
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Fixed
File:
1

Details

tilespec.c:6486:58: runtime error: index 6 out of bounds for type 'citizen_graphic 4'

Freeciv version 3.1.91.2-dev gui-gtk-3.22

freeciv version current git, which is commit e150f546d996c607d2da5fe6ddc398d57b105a15

found with gcc 11.2.0 -fsanitize=address,undefined

Ticket History (3/5 Histories)

2022-02-26 09:08 Updated by: mortmann
  • New Ticket "tilespec.c:6486:58: runtime error: index 6 out of bounds for type citizen_graphic 4" created
2022-02-26 09:34 Updated by: alienvalkyrie
  • Milestone Update from (None) to 3.2.0
  • Component Update from (None) to Client common
Comment

Likely introduced in commit 040ae83 / hrm Feature #683532. The given citizen type, which may be either a regular citizen or specialist, is used before determining which of the two it is.

This likely works correctly otherwise, since the citizen and specialist graphics are right next to each other in the struct, so reading past the end of the citizen array correctly reads from the specialist array.

2022-03-02 03:05 Updated by: alienvalkyrie
  • Owner Update from (None) to alienvalkyrie
  • Resolution Update from None to Accepted
2022-03-03 18:40 Updated by: alienvalkyrie
  • Status Update from Open to Closed
  • Resolution Update from Accepted to Fixed

Edit

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login