Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fix out of bounds crash on evidence
  • Loading branch information
oldmud0 committed Jul 28, 2021
1 parent 78f3e1d commit 5566cdf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/packets.cpp
Expand Up @@ -378,7 +378,7 @@ void AOClient::pktRemoveEvidence(AreaData* area, int argc, QStringList argv, AOP
return;
bool is_int = false;
int idx = argv[0].toInt(&is_int);
if (is_int && idx <= area->evidence().size() && idx >= 0) {
if (is_int && idx < area->evidence().size() && idx >= 0) {
area->deleteEvidence(idx);
}
sendEvidenceList(area);
Expand All @@ -391,7 +391,7 @@ void AOClient::pktEditEvidence(AreaData* area, int argc, QStringList argv, AOPac
bool is_int = false;
int idx = argv[0].toInt(&is_int);
AreaData::Evidence evi = {argv[1], argv[2], argv[3]};
if (is_int && idx <= area->evidence().size() && idx >= 0) {
if (is_int && idx < area->evidence().size() && idx >= 0) {
area->replaceEvidence(idx, evi);
}
sendEvidenceList(area);
Expand Down

0 comments on commit 5566cdf

Please sign in to comment.