[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) 2021-03-19 00:43:13 -04:00 committed by GitHub
parent 5b74f1e756
commit 323f5ea92e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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);