From 029d929b1b2043503ff458ac143efa6c2f060099 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 2 May 2011 22:20:58 +0200 Subject: [PATCH] Restrict xundump to tables with a file name Tables with a file name are: any game state, and any table that's initialized from a .config file. Tables that are no longer customizable: "updates" (customization had no effect, because update_get_schedule() overwrote it), "table", "meta" and the symbol tables (customization couldn't change them anyway), and news-chr (customizing r_newsstory[] was kind of neat, but unsafe because they are format strings for sprintf()). --- src/lib/common/xundump.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/common/xundump.c b/src/lib/common/xundump.c index fbf1b9c2e..5d8190801 100644 --- a/src/lib/common/xundump.c +++ b/src/lib/common/xundump.c @@ -784,7 +784,8 @@ xuheader(FILE *fp, int expected_table) return gripe("Expected table `%s', not `%s'", ef_nameof(expected_table), name); - if (!ef_cadef(type) || !(ef_flags(type) & EFF_MEM)) { + if (!empfile[type].file + || !ef_cadef(type) || !(ef_flags(type) & EFF_MEM)) { CANT_HAPPEN(expected_table != EF_BAD); return gripe("Table `%s' is not permitted here", name); } -- 2.43.0