mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2026-09-10 21:06:51 +00:00
goodixmoc: Handle invalid finger number
A modified device may supply invalid data, leading to libfprint crashes Reported by: Keith Linneman (LinnemanLabs)
This commit is contained in:
committed by
Marco Trevisan
parent
d9374963cd
commit
f15a62b5aa
@@ -416,6 +416,13 @@ gx_proto_parse_body (uint16_t cmd, FpiByteReader *byte_reader, pgxfp_cmd_respons
|
||||
&presp->finger_list_resp.finger_num))
|
||||
g_return_val_if_reached (-1);
|
||||
|
||||
if (presp->finger_list_resp.finger_num > FP_MAX_FINGERNUM)
|
||||
{
|
||||
g_warning ("Device reported too many fingers (%d)",
|
||||
presp->finger_list_resp.finger_num);
|
||||
return -1;
|
||||
}
|
||||
|
||||
for(uint8_t num = 0; num < presp->finger_list_resp.finger_num; num++)
|
||||
{
|
||||
uint16_t fingerid_length;
|
||||
|
||||
Reference in New Issue
Block a user