str_alloc crash, null?

Posted by Zeno on Sat 26 Mar 2005 09:05 PM — 4 posts, 15,915 views.

USA #0
#0  0x080e720c in str_alloc (str=0x0) at hashstr.c:50
#1  0x0816ccb7 in editor_clear_buf (ch=0x9ddaff8, edd=0x9de1e98, argument=0xbffebf52 "") at editor.c:616
#2  0x0816c746 in edit_buffer (ch=0x9ddaff8, argument=0xbffebf52 "") at editor.c:446
#3  0x080bed9c in game_loop () at comm.c:691
#4  0x080be62d in main (argc=8, argv=0xbffec390) at comm.c:317


But in frame 3...
(gdb) f 3
#3  0x080bed9c in game_loop () at comm.c:691
691                                     edit_buffer( d->character, cmdline );

(gdb) p cmdline
$4 = "/c\000and\000 up for the 10 Yen lapdances? o.o\000le decide to molest me\000s... =/\000angerous\000because of all the\000) Smiling he tells Hayaku to try.\000 gasped for air. His wounds began to heal around his chest and arm"...


Is cmdline suppose to be stored as that? :/
Canada #1
Just means that their command was /c, since the next character is \0, the null character.
USA #2
In any case,

#0 0x080e720c in str_alloc (str=0x0) at hashstr.c:50

... you have a NULL string somewhere trying to be allocated :)
USA #3
Yeah I realized that. This is uh, Cronel's new editor snippet for Smaug. Heard about this bug from someone today. Would a simple ifcheck suffice?