Mini Patch 2

This mini patch fixes a bug in command.c that can cause a server to dump core.

The file command.c in 2.2.2, 2.2.3, and 2.2.4 has one place where it calls Parent(Location(player)) without first checking that Location(player) is valid. Should the player variable be pointing to a room dbref instead of a player or object dbref, the server might dump core.

Andrew Molitor found this one in 2.2.2 and described it thusly:

        In command.c, around like 1250 or so, immediately before we decide
to 'check the master room', there is an if like this:

            if ((parent != Location(player)) &&
                (parent != Parent(Location(player)))) {

        Unfortunately, if player happens to be a room, its location is -3,
and Parent() happily looks into the array db[-3], which is bad.

        I added an extra clause:

            if ((parent != Location(player)) && (Location(player) >= 0) &&
                (parent != Parent(Location(player)))) {

        just for the hell of it.

Joel Baker reports the bug is also in the stock 2.2.4 release near line 1280. He suggests:

            if ((Good_obj(Location(player))) && (parent != Location(player)) &&
                (parent != Parent(Location(player)))) {

Andrew's fix is running on one MUSH. Joel's fix is known to compile. Neither have been tested extensively, yet. Since the server doesn't core dump every time it runs this section of code, I've found it impossible to find a test setup that will reproduce the bug on demand.

I trust it enough to run it on my own mush, though.


Frames Homepage Non-Frames Homepage

Say no to monopolies, BOYCOTT MICROSOFT!
KMFMS, one of the Angry Penguins.
[U.S. Flag] In memory of those who died Sept. 11, 2001 at the World Trade Center, the Pentagon, and on American Airlines Flight 11, United Airlines Flight 175, American Airlines Flight 77, and United Airlines Flight 93
Honoring Marsh & McLennan professionals I've worked with, including:
Jack Aron, Valerie Hanna, Joe Sisolak, Greg Reda, and Cathy Fagan.
Shattered Photoessay by James Nachtewy

Comments may be sent to gyles19@nospam.visi.com

This page last updated Sunday, 17-May-1998 22:18:11 CDT.