Use strn0cpy instead of strcpy when copying consent name buffers

Add nullptr checks to consent functions that accept char pointers
This commit is contained in:
hg
2020-01-30 20:00:01 -05:00
parent 9689787e56
commit 14c070f845
3 changed files with 22 additions and 15 deletions
+2 -2
View File
@@ -1489,8 +1489,8 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
// send the message to the client being granted or denied permission
auto outapp = new EQApplicationPacket(OP_ConsentResponse, sizeof(ConsentResponse_Struct));
ConsentResponse_Struct* crs = (ConsentResponse_Struct*)outapp->pBuffer;
strcpy(crs->grantname, s->grantname);
strcpy(crs->ownername, s->ownername);
strn0cpy(crs->grantname, s->grantname, sizeof(crs->grantname));
strn0cpy(crs->ownername, s->ownername, sizeof(crs->ownername));
crs->permission = s->permission;
strn0cpy(crs->zonename, s->zonename, sizeof(crs->zonename));
grant_client->QueuePacket(outapp);