Login
User Name:

Password:



Register

Forgot your password?
do_owhere recursive
Author: Khonsu
Submitted by: Khonsu
Changes list / Addchange
Author: Khonsu
Submitted by: Khonsu
6Dragons mp3 sound pack
Author: Vladaar
Submitted by: Vladaar
AFKMud 2.2.3
Author: AFKMud Team
Submitted by: Samson
SWFOTEFUSS 1.5
Author: Various
Submitted by: Samson
Users Online
AhrefsBot, DotBot, Bing

Members: 0
Guests: 35
Stats
Files
Topics
Posts
Members
Newest Member
489
3,791
19,644
596
Elwood

Today's Birthdays
There are no member birthdays today.
» SmaugMuds » Bugfix Lists » SWR FUSS Bugfix List » [Bug] Setplanet has no checks...
Forum Rules | Mark all | Recent Posts

[Bug] Setplanet has no checks for name argument
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Jan 2, 2009 1:14 pm   
Go to the top of the page
Go to the bottom of the page

InfiniteAxis
Off the Edge of the Map
GroupAdministrators
Posts1,200
JoinedMar 21, 2006

 
Bug: Setplanet has no checks for name argument
Danger: High - Planet files could be lost or corrupted.
Found by: Keberus
Fixed by: Keberus

---

planets.c, do_setplanet

Locate:
   if( !strcmp( arg2, "name" ) )
   {
      STRFREE( planet->name );
      planet->name = STRALLOC( argument );
      send_to_char( "Done.\r\n", ch );
      save_planet( planet );
      return;
   }


Change it to:
   if( !strcmp( arg2, "name" ) )
   {
      PLANET_DATA *tplanet;
      if( !argument || argument[0] == '\0' )
      {
         send_to_char( "You must choose a name.\r\n", ch );
         return;
      }
      if( ( tplanet = get_planet( argument ) ) != NULL )
      {
         send_to_char( "A planet with that name already Exists!\r\n", ch );
         return;
      }

      STRFREE( planet->name );
      planet->name = STRALLOC( argument );
      send_to_char( "Done.\r\n", ch );
      save_planet( planet );
      return;
   }


This will make sure that the planet name exists and make sure that you don't set it to the same name as a different planet.

Pages:<< prev 1 next >>