char.Char.sendaround() crashes when other characters in room

Bug #686806 reported by Andrew Venzor
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
NakedMud
New
Undecided
Unassigned

Bug Description

Simple to reproduce: exec ch.sendaround("Test")

Arose when attempt to use the function in a pymodule.

backtrace:

#0 0xb7d94153 in PyDict_SetItem () from /usr/lib/libpython2.6.so.1.0
#1 0xb7d943bf in PyDict_SetItemString () from /usr/lib/libpython2.6.so.1.0
#2 0x0809edf7 in PyChar_sendaround (self=0xb79f01b0, args=0x8298a8c, kwds=0x0)
    at scripts/pychar.c:843
#3 0xb7d95ca8 in PyCFunction_Call () from /usr/lib/libpython2.6.so.1.0
#4 0xb7df645e in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#5 0xb7df7cbd in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#6 0xb7df7dd3 in PyEval_EvalCode () from /usr/lib/libpython2.6.so.1.0
#7 0xb7e159be in PyRun_StringFlags () from /usr/lib/libpython2.6.so.1.0
#8 0xb7df737f in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#9 0xb7df7cbd in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#10 0xb7d7fe97 in ?? () from /usr/lib/libpython2.6.so.1.0
#11 0xb7d50edc in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#12 0xb7df0c24 in PyEval_CallObjectWithKeywords ()
   from /usr/lib/libpython2.6.so.1.0
#13 0x08085945 in charTryCmd (ch=0x82e3558, cmd=0xb7f1eff4, arg=0x0)
    at command.c:312
#14 0x080692c4 in do_cmd (ch=0x82e3558,
    arg=0x82aa06c "exec ch.sendaround(\"Test\")", aliases_ok=1 '\001')
    at interpret.c:343
#15 0x080693fc in handle_cmd_input (dsock=0x82de8f0,
    arg=0x82aa06c "exec ch.sendaround(\"Test\")") at interpret.c:268
#16 0x080a6ea6 in mudsys_handle_cmd_input (self=0x0, args=0x82807cc)
    at scripts/pymudsys.c:662
#17 0xb7d95c92 in PyCFunction_Call () from /usr/lib/libpython2.6.so.1.0
#18 0xb7d50edc in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#19 0xb7df0c24 in PyEval_CallObjectWithKeywords ()
   from /usr/lib/libpython2.6.so.1.0
#20 0x08071e83 in input_handler () at socket.c:874
#21 0x080643ec in game_loop (control=5) at gameloop.c:417
#22 0x0806499a in main (argc=1, argv=0xbffff804) at gameloop.c:320

Revision history for this message
Bartek Jasicki (thindil) wrote :

Main reason why this error appear: in function PyChar_sendaround in pychar.c during iteration via list there no check if dict isn't NULL. This bug should be fixed by replacing line 843:

PyDict_SetItemString(dict, "ch", charGetPyFormBorrowed(ch));

on

if (dict != NULL)
 {
   PyDict_SetItemString(dict, "ch", charGetPyFormBorrowed(ch));
 }

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers