Verify the header in the logbook and profile are identical.
Unless we have a bug in the logbook processing logic, both logbook headers should always be identical. But it doesn't hurt to check explicitly.
This commit is contained in:
parent
9366e36309
commit
ae763c3f58
@ -455,6 +455,15 @@ hw_frog_device_foreach (dc_device_t *abstract, dc_dive_callback_t callback, void
|
||||
return rc;
|
||||
}
|
||||
|
||||
// Verify the header in the logbook and profile are identical.
|
||||
if (memcmp (profile, header + offset, RB_LOGBOOK_SIZE) != 0) {
|
||||
ERROR (abstract->context, "Unexpected profile header.");
|
||||
free (profile);
|
||||
free (header);
|
||||
return rc;
|
||||
|
||||
}
|
||||
|
||||
if (callback && !callback (profile, length, profile + 9, sizeof (device->fingerprint), userdata))
|
||||
break;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user