upekts: Fix use-after-free in an error condition

The callback function would continue processing even after having failed
the SSM already. This causes further invalid operations on the SSM.

This error was found using a coverity scan.
This commit is contained in:
Benjamin Berg 2020-01-21 12:34:40 +01:00 committed by Marco Trevisan
parent 3b47113122
commit 88461d53ec

View file

@ -902,8 +902,10 @@ enroll_start_sm_cb_msg28 (FpDevice *dev,
FpiSsm *ssm = user_data;
if (error)
{
fpi_ssm_mark_failed (ssm, error);
if (type != READ_MSG_RESPONSE)
}
else if (type != READ_MSG_RESPONSE)
{
fp_err ("expected response, got %d seq=%x", type, seq);
fpi_ssm_mark_failed (ssm, fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,