mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2026-09-10 13:00:08 +00:00
fpcmoc: Copy the error before sending to the SSM
The SSM error is stolen and then we pass to the resume/suspend callback potentially leading to a double-free. So copy it before re-using it. Reported by: Keith Linneman (LinnemanLabs)
This commit is contained in:
committed by
Marco Trevisan
parent
3138ad0c8a
commit
092c0dfc31
@@ -92,7 +92,7 @@ fpc_suspend_resume_cb (FpiUsbTransfer *transfer,
|
||||
if (ssm_state == FPC_CMD_SUSPENDED)
|
||||
{
|
||||
if (error)
|
||||
fpi_ssm_mark_failed (transfer->ssm, error);
|
||||
fpi_ssm_mark_failed (transfer->ssm, g_error_copy (error));
|
||||
|
||||
fpi_device_suspend_complete (device, error);
|
||||
/* The resume handler continues to the next state! */
|
||||
@@ -100,7 +100,7 @@ fpc_suspend_resume_cb (FpiUsbTransfer *transfer,
|
||||
else if (ssm_state == FPC_CMD_RESUME)
|
||||
{
|
||||
if (error)
|
||||
fpi_ssm_mark_failed (transfer->ssm, error);
|
||||
fpi_ssm_mark_failed (transfer->ssm, g_error_copy (error));
|
||||
else
|
||||
fpi_ssm_jump_to_state (transfer->ssm, FPC_CMD_GET_DATA);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user