forked from github/server
coverity scan CID 22516: out-of-bounds write
potentially a bug with bad XML files? only matters if we have those, but we shouldn't
This commit is contained in:
parent
8b92003fff
commit
2372d3aacd
|
@ -1815,6 +1815,7 @@ static int parse_races(xmlDocPtr doc)
|
|||
if (result->nodesetval->nodeNr > MAXMAGIETYP) {
|
||||
log_error("race %s has %d potential familiars", rc->_name, result->nodesetval->nodeNr);
|
||||
}
|
||||
else {
|
||||
for (k = 0; k != MAXMAGIETYP; ++k) {
|
||||
if (k < result->nodesetval->nodeNr) {
|
||||
xmlNodePtr node = result->nodesetval->nodeTab[k];
|
||||
|
@ -1830,10 +1831,12 @@ static int parse_races(xmlDocPtr doc)
|
|||
rc->familiars[k] = frc;
|
||||
}
|
||||
xmlFree(propValue);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
rc->familiars[k] = frc;
|
||||
}
|
||||
}
|
||||
}
|
||||
xmlXPathFreeObject(result);
|
||||
|
||||
/* reading eressea/races/race/precombatspell */
|
||||
|
|
Loading…
Reference in New Issue