ef_verify: Run verify_row() even for tables without selectors

verify_table() skips verify_row() when the table doesn't have
selectors.  But verify_row()'s test for corrupt headers in EFF_TYPED
tables doesn't require selectors.  Harmless, since the two tables that
don't have selectors (EF_MAP and EF_BMAP) aren't EFF_TYPED.  Clean it
up anyway.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2016-06-26 06:51:25 +02:00
parent 18b5d16248
commit 6e9f256c68

View file

@ -72,7 +72,7 @@ verify_ca(int type)
struct castr *ca = ef_cadef(type);
int i;
for (i = 0; ca[i].ca_name; i++) {
for (i = 0; ca && ca[i].ca_name; i++) {
/*
* Virtual selectors can't be used in xundump, since we lack a
* setter to go with ca_get().
@ -160,7 +160,7 @@ verify_row(int type, int row)
if (!empobj_in_use(type, row_ref))
goto out;
for (i = 0; ca[i].ca_name; ++i) {
for (i = 0; ca && ca[i].ca_name; ++i) {
if (ca[i].ca_get)
continue; /* virtual */
n = CA_ARRAY_LEN(&ca[i]);
@ -201,8 +201,6 @@ verify_table(int type)
int retval = 0;
int i;
if (!ef_cadef(type))
return 0;
verify_ca(type);
for (i = 0; i < ef_nelem(type); i++)
retval |= verify_row(type, i);