Skip to content

Commit 5566cdf

Browse files
authored
Fix out of bounds crash on evidence
1 parent 78f3e1d commit 5566cdf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: core/src/packets.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ void AOClient::pktRemoveEvidence(AreaData* area, int argc, QStringList argv, AOP
378378
return;
379379
bool is_int = false;
380380
int idx = argv[0].toInt(&is_int);
381-
if (is_int && idx <= area->evidence().size() && idx >= 0) {
381+
if (is_int && idx < area->evidence().size() && idx >= 0) {
382382
area->deleteEvidence(idx);
383383
}
384384
sendEvidenceList(area);
@@ -391,7 +391,7 @@ void AOClient::pktEditEvidence(AreaData* area, int argc, QStringList argv, AOPac
391391
bool is_int = false;
392392
int idx = argv[0].toInt(&is_int);
393393
AreaData::Evidence evi = {argv[1], argv[2], argv[3]};
394-
if (is_int && idx <= area->evidence().size() && idx >= 0) {
394+
if (is_int && idx < area->evidence().size() && idx >= 0) {
395395
area->replaceEvidence(idx, evi);
396396
}
397397
sendEvidenceList(area);

0 commit comments

Comments
 (0)