Skip to content
Snippets Groups Projects
Commit 91ac7430 authored by Wesley W. Terpstra's avatar Wesley W. Terpstra
Browse files

Confirm it's a header!

parent 36161511
Branches
Tags
No related merge requests found
......@@ -286,6 +286,13 @@ static void eb_sdwb_got_header(eb_user_data_t mydata, eb_operation_t ops, eb_sta
return;
}
/* Is the magic there? */
if (strncmp((const char*)&header.s.magic[0], "SDWBHEAD", 8) != 0) {
eb_free_sdwb_scan(scanp);
(*cb)(data, 0, EB_FAIL);
return;
}
/* scan is still valid because eb_operation_* do not allocate */
scan->devices = be64toh(header.s.wbddb_size) / 80;
......
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