[Bug] mptrlook command crashes with an empty target room argument
< Newer Topic
:: Older Topic >
AFKMud 2.02
Pages:<< prev 1 next >>
#1 Nov 23, 2007 12:59 pm
Black Hand
GroupAdministrators
Posts3,697
JoinedJan 1, 2002
Bug: mptrlook command crashes with an empty target room argument
Danger: High - Crash bug. A missing room argument crashes the game.
Discovered in: AFKMud 2.02
Found by: Samson
Fixed by: Samson
---
mud_comm.cpp, do_mptrlook
Locate:
Change to:
The ifcheck in this small chunk is meant to see if the arg2 value is empty, blank, or otherwise invalid and default to using the room the PC is in as the target. However the check is setup wrong and would actually result in a crash condition if the argument is empty because the location value is then never assigned.
Danger: High - Crash bug. A missing room argument crashes the game.
Discovered in: AFKMud 2.02
Found by: Samson
Fixed by: Samson
---
mud_comm.cpp, do_mptrlook
Locate:
if( arg2 && arg2[0] == '\0' ) location = ch->in_room;
Change to:
if( !arg2 || arg2[0] == '\0' ) location = ch->in_room;
The ifcheck in this small chunk is meant to see if the arg2 value is empty, blank, or otherwise invalid and default to using the room the PC is in as the target. However the check is setup wrong and would actually result in a crash condition if the argument is empty because the location value is then never assigned.
Pages:<< prev 1 next >>