From 65b23ad812fb7ac02c251def8da7127452147d1b Mon Sep 17 00:00:00 2001 From: Rumble Date: Sun, 25 Jan 2009 22:16:21 +0000 Subject: [PATCH] Added new zone creation limits to prevent misuse of zedit making the MUD unbootable. --Rumble --- changelog | 3 +++ src/genzon.c | 11 ++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/changelog b/changelog index f1e4599..3fb3dd6 100644 --- a/changelog +++ b/changelog @@ -35,6 +35,9 @@ export (QQ's a zone into a tarball)t Xlist (mlist, olist, rlist, zlist, slist, tlist, qlist) (lots of major bugfixes too) tbaMUD 3.59 +[Jan 25 2009] - Rumble + Added new documentation /doc unixshelladminguide. (thanks Jamdog). + Added new zone creation limits to prevent misuse of zedit making the MUD unbootable. [Jan 25 2009] - Jamdog Added cases for missing object types in oedit_disp_val1_menu (other, worn, treasure, trash, key, pen, boat) [Jan 25 2009] - Rumble diff --git a/src/genzon.c b/src/genzon.c index e11ab5d..b070642 100644 --- a/src/genzon.c +++ b/src/genzon.c @@ -51,17 +51,26 @@ zone_rnum create_new_zone(zone_vnum vzone_num, room_vnum bottom, room_vnum top, { FILE *fp; struct zone_data *zone; - int i; + int i, max_zone; zone_rnum rznum; char buf[MAX_STRING_LENGTH]; #if CIRCLE_UNSIGNED_INDEX + max_zone = 655; if (vzone_num == NOWHERE) { #else + max_zone = 327; if (vzone_num < 0) { #endif *error = "You can't make negative zones.\r\n"; return NOWHERE; + } else if (vzone_num > max_zone) { +#if CIRCLE_UNSIGNED_INDEX + *error = "New zone cannot be higher than 655.\r\n"; +#else + *error = "New zone cannot be higher than 327.\r\n"; +#endif + return NOWHERE; } else if (bottom > top) { *error = "Bottom room cannot be greater than top room.\r\n"; return NOWHERE;