[Bug Fix] Add Bounds Checking to OP_LFGCommand Comment Processing

Theoretically this could be used to corrupt memory, but they would have
to get extremely lucky to actually execute a successful attack
This commit is contained in:
Michael Cook (mackal) authored and GitHub committed 2021-03-18 23:43:13 -05:00
1 parent 5b74f1e756
commit 323f5ea92e
1 file changed
+1 -1
+1 -1
View File
@@ -9190,7 +9190,7 @@ void Client::Handle_OP_LFGCommand(const EQApplicationPacket *app)
LFGFromLevel = lfg->FromLevel;
LFGToLevel = lfg->ToLevel;
LFGMatchFilter = lfg->MatchFilter;
strcpy(LFGComments, lfg->Comments);
strn0cpy(LFGComments, lfg->Comments, sizeof(LFGComments));
break;
default:
Message(0, "Error: unknown LFG value %i", lfg->value);