mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-01 19:13:55 -07:00
Prevent bad access potential for removals by checking bounds (#4617)
* Prevent bad access potential for removals by checking bounds Fix #4616 Switch to removeOne instead of bound checking removeAt * Revert server cardzone check
This commit is contained in:
parent
b02adccf87
commit
3e90f109a2
7 changed files with 10 additions and 12 deletions
|
|
@ -43,9 +43,8 @@ public:
|
|||
}
|
||||
void removeArrowFrom(ArrowItem *arrow)
|
||||
{
|
||||
arrowsFrom.removeAt(arrowsFrom.indexOf(arrow));
|
||||
arrowsFrom.removeOne(arrow);
|
||||
}
|
||||
|
||||
const QList<ArrowItem *> &getArrowsTo() const
|
||||
{
|
||||
return arrowsTo;
|
||||
|
|
@ -56,8 +55,7 @@ public:
|
|||
}
|
||||
void removeArrowTo(ArrowItem *arrow)
|
||||
{
|
||||
arrowsTo.removeAt(arrowsTo.indexOf(arrow));
|
||||
arrowsTo.removeOne(arrow);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue