]> git.pond.sub.org Git - empserver/commitdiff
(xuheader): Check for unexpected table before oopsing on !EFF_MEM.
authorMarkus Armbruster <armbru@pond.sub.org>
Wed, 8 Feb 2006 21:41:48 +0000 (21:41 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Wed, 8 Feb 2006 21:41:48 +0000 (21:41 +0000)
src/lib/common/xundump.c

index c5d88c5b380e9c844292cb9b20b63de11da5dcb6..066e5509f8daff772059ae53064c2fc345d98082 100644 (file)
@@ -565,7 +565,6 @@ static int
 xuheader(FILE *fp, int expected_table)
 {
     char name[64];
 xuheader(FILE *fp, int expected_table)
 {
     char name[64];
-    struct empfile *ep;
     int res, ch;
     int type;
 
     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);
     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 (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;
 }
 
     return type;
 }