mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-08-07 01:49:09 +00:00
smartcard: Do not crash if reader_id is invalid
Avoid client to trigger crash. The value of smartcard_readers_get is checked for NULL so returning it it's not an issue. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Victor Toso <victortoso@redhat.com>
This commit is contained in:
parent
18877d1af8
commit
57d02c2d17
@ -222,7 +222,9 @@ static int smartcard_char_device_add_to_readers(RedsState *reds, SpiceCharDevice
|
||||
|
||||
SpiceCharDeviceInstance *smartcard_readers_get(uint32_t reader_id)
|
||||
{
|
||||
spice_assert(reader_id < g_smartcard_readers.num);
|
||||
if (reader_id >= g_smartcard_readers.num) {
|
||||
return NULL;
|
||||
}
|
||||
return g_smartcard_readers.sin[reader_id];
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user