mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2026-09-10 21:06:51 +00:00
uru4000: Ensure we do not overflow image buffer on reading
Reported by: Keith Linneman (LinnemanLabs)
This commit is contained in:
committed by
Marco Trevisan
parent
ad8a6f6b17
commit
657c764b73
@@ -755,6 +755,17 @@ imaging_run_state (FpiSsm *ssm, FpDevice *_dev)
|
|||||||
if (num_lines == 0)
|
if (num_lines == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
/* num_lines is device-supplied; make sure decoding this block stays
|
||||||
|
* within the captured image buffer (IMAGE_HEIGHT rows). */
|
||||||
|
if ((size_t) self->img_lines_done + num_lines > IMAGE_HEIGHT)
|
||||||
|
{
|
||||||
|
fp_err ("bad captured image: block %d (%d lines) overflows buffer",
|
||||||
|
self->img_block, num_lines);
|
||||||
|
fpi_ssm_mark_failed (ssm,
|
||||||
|
fpi_device_error_new (FP_DEVICE_ERROR_PROTO));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
fp_dbg ("%d %02x %d", self->img_block, flags,
|
fp_dbg ("%d %02x %d", self->img_block, flags,
|
||||||
num_lines);
|
num_lines);
|
||||||
if (flags & BLOCKF_CHANGE_KEY)
|
if (flags & BLOCKF_CHANGE_KEY)
|
||||||
|
|||||||
Reference in New Issue
Block a user