World Crash: CommandItemAdd
Moderators: Community Managers, Developers
- John Adams
- Retired
- Posts: 4581
- Joined: Wed Aug 28, 2013 9:40 am
- Location: Phoenix, AZ.
- Contact:
World Crash: CommandItemAdd
New opportunity:
Stack
Code:
Pretty sure cmd_index + 2 was null, though I thought we checked it above this:
Oh.
I think that needs to be 2.
Stack
Code: Select all
WorldServer.exe!strlen(unsigned char * buf) Line 69 Unknown
> WorldServer.exe!Separator::IsNumber(int index) Line 203 C++
WorldServer.exe!CommandProcess::CommandItemAdd(std::shared_ptr<Client> & client, Separator * sep, unsigned char cmd_index, bool world_client) Line 2359 C++
WorldServer.exe!CommandProcess::Process(std::shared_ptr<Client> & client, Separator * sep, unsigned char command_index, bool world_client) Line 245 C++
WorldServer.exe!ChunkServer::HandleChatSay(std::shared_ptr<Client> & client, PacketStruct * packet_struct) Line 940 C++
WorldServer.exe!ChunkServer::ProcessPackets() Line 340 C++
WorldServer.exe!ChunkPacketThread(void * data) Line 134 C++
WorldServer.exe!ThreadRun(void * arg) Line 77 C++
WorldServer.exe!_callthreadstart() Line 255 C
WorldServer.exe!_threadstart(void * ptd) Line 239 C
kernel32.dll!7689338a() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]
ntdll.dll!76f99f72() Unknown
ntdll.dll!76f99f45() Unknown
Code: Select all
// Get the second arg and check that it is a valid number
arg = cmd_index + 2;
if (sep->IsNumber(arg)) {
uint32_t item_id = sep->GetInt(arg);
item = item_info_list->GetItemInfoById(item_id);
}
Oh.
Code: Select all
// Make sure we have an arg, and that it is a valid number
if (sep->GetSize() <= cmd_index + 1)
{
snprintf(buffer, sizeof(buffer), "<Red=>Command Error: Invalid syntax. Use .item add [player name] [item id]");
SendMessageToPlayer(client, buffer, world_client);
LogError(LOG_COMMAND, 0, "CommandItem: No valid id argument after .item list");
return;
}
Re: World Crash: CommandItemAdd
Yep. Fixed that and cleaned up that code segment. Not sure how that was missed for this long during testing.
I will be more active now so I will start testing more heavily again.
I will be more active now so I will start testing more heavily again.