mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-21 20:11:12 +00:00
Fix buffer overflow when tag bits are set
This commit is contained in:
parent
dfd05c6172
commit
7e7ff84f08
1 changed files with 5 additions and 5 deletions
|
@ -180,10 +180,10 @@ void Taggroup_Add (taggroup_t *garray[], const mtag_t tag, size_t id)
|
||||||
if (Taggroup_Find(group, id) != (size_t)-1)
|
if (Taggroup_Find(group, id) != (size_t)-1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (! in_bit_array(tags_available, tag))
|
if (! in_bit_array(tags_available, (UINT16)tag))
|
||||||
{
|
{
|
||||||
num_tags++;
|
num_tags++;
|
||||||
set_bit_array(tags_available, tag);
|
set_bit_array(tags_available, (UINT16)tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create group if empty.
|
// Create group if empty.
|
||||||
|
@ -220,10 +220,10 @@ static void Taggroup_Add_Init(taggroup_t *garray[], const mtag_t tag, size_t id)
|
||||||
|
|
||||||
group = garray[(UINT16)tag];
|
group = garray[(UINT16)tag];
|
||||||
|
|
||||||
if (! in_bit_array(tags_available, tag))
|
if (! in_bit_array(tags_available, (UINT16)tag))
|
||||||
{
|
{
|
||||||
num_tags++;
|
num_tags++;
|
||||||
set_bit_array(tags_available, tag);
|
set_bit_array(tags_available, (UINT16)tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create group if empty.
|
// Create group if empty.
|
||||||
|
@ -271,7 +271,7 @@ void Taggroup_Remove (taggroup_t *garray[], const mtag_t tag, size_t id)
|
||||||
if (group->count == 1 && total_elements_with_tag(tag) == 1)
|
if (group->count == 1 && total_elements_with_tag(tag) == 1)
|
||||||
{
|
{
|
||||||
num_tags--;
|
num_tags--;
|
||||||
unset_bit_array(tags_available, tag);
|
unset_bit_array(tags_available, (UINT16)tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Strip away taggroup if no elements left.
|
// Strip away taggroup if no elements left.
|
||||||
|
|
Loading…
Reference in a new issue