Commit b350cb69 authored by Rusty Russell's avatar Rusty Russell

tdb2: check that records are of sufficient length in tdb_check.

parent 453d3fe2
......@@ -372,6 +372,14 @@ int tdb_check(struct tdb_context *tdb,
if (tdb->methods->oob(tdb, off + len, false))
goto fail;
if (len < sizeof(p->f)) {
tdb->log(tdb, TDB_DEBUG_ERROR, tdb->log_priv,
"tdb_check: too short record %llu at"
" %llu\n",
(long long)len, (long long)off);
goto fail;
}
if (off + sizeof(p->u) == tdb->header.v.hash_off) {
hash_found = true;
} else if (off + sizeof(p->u)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment