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.
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.