From: Markus Armbruster Date: Wed, 8 Feb 2006 21:41:48 +0000 (+0000) Subject: (xuheader): Check for unexpected table before oopsing on !EFF_MEM. X-Git-Tag: PZ5~83 X-Git-Url: http://git.pond.sub.org/?p=empserver;a=commitdiff_plain;h=72127c838f65d8e372e5fd51859bb28cd683b38d (xuheader): Check for unexpected table before oopsing on !EFF_MEM. --- diff --git a/src/lib/common/xundump.c b/src/lib/common/xundump.c index c5d88c5b3..066e5509f 100644 --- a/src/lib/common/xundump.c +++ b/src/lib/common/xundump.c @@ -565,7 +565,6 @@ static int xuheader(FILE *fp, int expected_table) { char name[64]; - struct empfile *ep; int res, ch; int type; @@ -589,13 +588,13 @@ xuheader(FILE *fp, int expected_table) type = ef_byname(name); if (type < 0) return gripe("Unknown table `%s'", name); - ep = &empfile[type]; - if (CANT_HAPPEN(!(ep->flags & EFF_MEM))) - return -1; /* not implemented */ - if (expected_table != EF_BAD && expected_table != type) return gripe("Expected table `%s', not `%s'", ef_nameof(expected_table), name); + + if (CANT_HAPPEN(!(ef_flags(type) & EFF_MEM))) + return -1; + return type; }