CID 22503 Negative array index write

github issue #387
I was pretty sure I had submitted this before. What is going on?
This commit is contained in:
Enno Rehling 2015-11-11 15:36:57 +01:00
parent dee05076ac
commit 3cd47bb8fa
1 changed files with 4 additions and 1 deletions

View File

@ -374,7 +374,10 @@ summary *make_summary(void)
s->factions++;
/* Problem mit Monsterpartei ... */
if (!is_monsters(f)) {
s->factionrace[old_race(f->race)]++;
int rc = old_race(f->race);
if (rc >= 0) {
s->factionrace[rc]++;
}
}
}
}