secugen: Protect against invalid fw_data

This fixes an issue detected by scan build
This commit is contained in:
Marco Trevisan (Treviño) 2026-06-17 19:41:57 +02:00
parent 5b34908a21
commit 726cf8a515

View file

@ -636,6 +636,12 @@ init_fw_read_cb (FpiUsbTransfer *transfer,
else
{
/* All FW data received - extract image processing parameters */
if (!self->fw_data)
{
fp_warn ("FW data buffer missing; skipping calibration extraction");
fpi_ssm_next_state (transfer->ssm);
return;
}
/* BLC region offsets: 16 × int16 at fw_data[0x0e] */
if (self->fw_data_len >= SECUGEN_BLC_OFFSETS_FW + 32)