spawn set location - crash

Old bugs stored here for reference.
Locked
User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

spawn set location - crash

Post by John Adams » Sun Aug 22, 2010 3:42 pm

With nothing targeted, performing the /spawn set location command crashes the world.

Code: Select all

   0: 01 00 0C 00 73 65 74 20 - 6C 6F 63 61 74 69 6F 6E  | ....set location

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb3bfeb70 (LWP 14815)]
0xb7b91073 in strlen () from /lib/tls/i686/cmov/libc.so.6
(gdb) bt
#0  0xb7b91073 in strlen () from /lib/tls/i686/cmov/libc.so.6
#1  0xb7f8050b in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) ()
   from /usr/lib/libstdc++.so.6
#2  0x080e4fda in Commands::Process (this=0x82f6ec0, index=1,
    command_parms=0xb3bfe0c4, client=0xb44006b0) at Commands.cpp:2571
#3  0x0812a23a in Client::HandlePacket (this=0xb44006b0, app=0xb4437b90)
    at client.cpp:1107
#4  0x0812dddc in Client::Process (this=0xb44006b0, zone_process=true)
    at client.cpp:1599
#5  0x081d621f in ZoneServer::ClientProcess (this=0xb4407d58)
    at zoneserver.cpp:1882
#6  0x081d95a1 in ZoneServer::Process (this=0xb4407d58) at zoneserver.cpp:883
#7  0x081d9a2e in ZoneLoop (tmp=0xb4407d58) at zoneserver.cpp:3878
#8  0xb7c6880e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#9  0xb7beaa0e in clone () from /lib/tls/i686/cmov/libc.so.6

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: spawn set location - crash

Post by Scatman » Sun Aug 22, 2010 4:24 pm

Commands.cpp line 2580

Changing

Code: Select all

case COMMAND_SPAWN_SET:{
	Spawn* spawn = client->GetPlayer()->GetTarget();
to

Code: Select all

case COMMAND_SPAWN_SET:{
	Spawn* spawn = client->GetPlayer()->GetTarget();
	if (!spawn) {
		client->SimpleMessage(CHANNEL_COLOR_YELLOW, "You must select a spawn in order to use /spawn set");
		break;
	}
should fix it.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: spawn set location - crash

Post by John Adams » Sun Aug 22, 2010 4:59 pm

SCAT! Holy shit. I just about fainted.

Btw, you know SVN is back, in case, you know, you wanted to see what it feels like to check something in ;)

If not, I'll do it tonight. No one else has crashed it there because it's a GM command that we've obviously never used.

User avatar
Sylaei
Retired
Posts: 57
Joined: Mon Jul 05, 2010 1:40 pm

Re: spawn set location - crash

Post by Sylaei » Sun Aug 22, 2010 8:32 pm

I found this error and corrected it. Needed a check for a null target.

Locked

Who is online

Users browsing this forum: No registered users and 0 guests