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

Members: 0
Guests: 17
Stats
Files
Topics
Posts
Members
Newest Member
489
3,793
19,649
597
Aileenutz

Today's Birthdays
There are no member birthdays today.
» SmaugMuds » Bugfix Lists » AFKMud Bugfix List » AFKMud Bug Archive » [Bug] Old ibuild code chunks ...
Forum Rules | Mark all | Recent Posts

[Bug] Old ibuild code chunks cause crashes when called from redit
< Newer Topic :: Older Topic > AFKMud 1.77

Pages:<< prev 1 next >>
Post is unread #1 Dec 2, 2006 10:31 pm   
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,685
JoinedJan 1, 2002

 
Bug: Old ibuild code chunks cause crashes when called from redit
Danger: High - Crash condition. Orphaned code which should have been deleted a long time ago.
Discovered in: AFKMud 1.77
Found by: Samson
Fixed by: Samson/Remcon

---

build.c, do_redit

Find and remove:
   if( !str_cmp( arg, "ex_flags" ) )
   {
      argument = one_argument( argument, arg2 );

      value = get_exflag( arg2 );
      if( value < 0 )
      {
         send_to_char( "Bad exit flag. \r\n", ch );
         return;
      }
      if( ( xit = get_exit( location, edir ) ) == NULL )
      {
         snprintf( buf, MAX_STRING_LENGTH, "exit %c 1", dir );
         do_redit( ch, buf );
         xit = get_exit( location, edir );
      }
      TOGGLE_BIT( xit->exit_info, 1 << value );
      return;
   }


   if( !str_cmp( arg, "ex_to_room" ) )
   {
      argument = one_argument( argument, arg2 );
      evnum = atoi( arg2 );
      if( evnum < 1 || evnum > MAX_VNUM )
      {
         send_to_char( "Invalid room number.\r\n", ch );
         return;
      }
      if( ( tmp = get_room_index( evnum ) ) == NULL )
      {
         send_to_char( "Non-existant room.\r\n", ch );
         return;
      }
      if( ( xit = get_exit( location, edir ) ) == NULL )
      {
         snprintf( buf, MAX_STRING_LENGTH, "exit %c 1", dir );
         do_redit( ch, buf );
         xit = get_exit( location, edir );
      }
      xit->vnum = evnum;
      return;
   }

   if( !str_cmp( arg, "ex_key" ) )
   {
      argument = one_argument( argument, arg2 );
      if( ( xit = get_exit( location, edir ) ) == NULL )
      {
         snprintf( buf, MAX_STRING_LENGTH, "exit %c 1", dir );
         do_redit( ch, buf );
         xit = get_exit( location, edir );
      }
      xit->key = atoi( arg2 );
      return;
   }

   if( !str_cmp( arg, "ex_exdesc" ) )
   {
      if( ( xit = get_exit( location, edir ) ) == NULL )
      {
         snprintf( buf, MAX_STRING_LENGTH, "exit %c 1", dir );
         do_redit( ch, buf );
      }
      snprintf( buf, MAX_STRING_LENGTH, "exdesc %c %s", dir, argument );
      do_redit( ch, buf );
      return;
   }

   if( !str_cmp( arg, "ex_keywords" ) )   /* not called yet */
   {
      if( ( xit = get_exit( location, edir ) ) == NULL )
      {
         snprintf( buf, MAX_STRING_LENGTH, "exit %c 1", dir );
         do_redit( ch, buf );
         if( ( xit = get_exit( location, edir ) ) == NULL )
            return;
      }
      snprintf( buf, MAX_STRING_LENGTH, "%s %s", xit->keyword, argument );
      STRFREE( xit->keyword );
      xit->keyword = STRALLOC( buf );
      return;
   }


These code blocks were left over from when the old ibuild interface code was still around. That interface was horribly broken and basically beyond repair so it was taken out. The orphaned leftovers of it still crop up from time to time, and these blocks in do_redit are crash traps waiting to happen.

Pages:<< prev 1 next >>