mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06: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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue