Consider the following:
I have 2 or more charmies and order them to perform some
command that will lead to death of first charmie. It will be pulled
off the followers list, then k = k->next will be called, but k points
to freed region of memory and crash will occur.
The bug is here:
for (k = ch->followers; k; k = k->next) {
if (org_room == k->follower->in_room)
if (AFF_FLAGGED(k->follower, AFF_CHARM)) {
found = TRUE;
command_interpreter(k->follower, message);
}
The obvious solution is adding next_k variable
and doing next_k = k->next at the beginning of
cycle but it's not applicable here:
If I order my charmie to cast fireball and both
charmies (first one and the one after it) die -
it will crash anyways because next_k will point
to non-existant charmie. :(
I see no other solutions, so I had to disable
"order all" command at all. :(
Any ideas?
Zmey // 3MoonsWorld (rmud.net.ru:4000)
+------------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
+------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST