mirror of
https://github.com/qemu/qemu.git
synced 2024-11-26 21:33:40 +08:00
ide: Fix off-by-one error in array index check
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
64ebe71aa0
commit
fb60105d49
@ -2039,7 +2039,7 @@ static int ide_drive_pio_post_load(void *opaque, int version_id)
|
||||
{
|
||||
IDEState *s = opaque;
|
||||
|
||||
if (s->end_transfer_fn_idx > ARRAY_SIZE(transfer_end_table)) {
|
||||
if (s->end_transfer_fn_idx >= ARRAY_SIZE(transfer_end_table)) {
|
||||
return -EINVAL;
|
||||
}
|
||||
s->end_transfer_func = transfer_end_table[s->end_transfer_fn_idx];
|
||||
|
Loading…
Reference in New Issue
Block a user