From: George (greerga@CIRCLEMUD.ORG)
Date: 01/05/98

On Mon, 5 Jan 1998, Mark A. Heilpern wrote:

>The function performs:  mob_index[SHOP_KEEPER(index)].func = shop_keeper;
>to assign the shop_keeper specproc. However, there is no sanity check to
>make sure SHOP_KEEPER(index) is a valid index and, in fact, in using
>OasisOLC to make shops, it is possible for this macro to return -1, having
>us write _below_ the mob_index pointer.  Now, a common malloc() technique,

Already know about it and is included in the 328k patch of changes I send
to Jeremy every few days. :)

>The fix is simple - just conditionalize on SHOP_KEEPER(index)>=0 and, if that
>condition is false, log a SYSERR.

if (SHOP_KEEPER(index) == NOBODY)

>In eQuoria, I also made "show errors" display keeperless shops, to more easily
>keep tabs on this.

Good idea, although I don't know how and why a shop wouldn't have a
shopkeeper off-hand.  Sounds like something in the world files to look

George Greer  -   | Genius may have its limitations, but stupidity | is not thus handicapped. -- Elbert Hubbard

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/15/00 PST