Follow up to 78b6c15
Fixed a possible buffer overflow in mapindex.c
This commit is contained in:
parent
78b6c150d2
commit
a760e01c59
@ -120,7 +120,7 @@ unsigned short mapindex_name2idx(const char* name, const char *func) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const char* mapindex_idx2name(unsigned short id, const char *func) {
|
const char* mapindex_idx2name(unsigned short id, const char *func) {
|
||||||
if (id > MAX_MAPINDEX || !mapindex_exists(id)) {
|
if (id >= MAX_MAPINDEX || !mapindex_exists(id)) {
|
||||||
ShowDebug("(%s) mapindex_id2name: Requested name for non-existant map index [%d] in cache.\n", func, id);
|
ShowDebug("(%s) mapindex_id2name: Requested name for non-existant map index [%d] in cache.\n", func, id);
|
||||||
return indexes[0].name; // dummy empty string so that the callee doesn't crash
|
return indexes[0].name; // dummy empty string so that the callee doesn't crash
|
||||||
}
|
}
|
||||||
|
@ -17656,7 +17656,7 @@ BUILDIN_FUNC(unitskillusepos)
|
|||||||
if (bl != NULL) {
|
if (bl != NULL) {
|
||||||
if (bl->type == BL_NPC) {
|
if (bl->type == BL_NPC) {
|
||||||
if (!((TBL_NPC*)bl)->status.hp)
|
if (!((TBL_NPC*)bl)->status.hp)
|
||||||
status_calc_npc(((TBL_NPC*)bl), SCO_FORCE);
|
status_calc_npc(((TBL_NPC*)bl), SCO_FIRST);
|
||||||
else
|
else
|
||||||
status_calc_npc(((TBL_NPC*)bl), SCO_NONE);
|
status_calc_npc(((TBL_NPC*)bl), SCO_NONE);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user