mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 19:26:25 +00:00
lguest: beyond ARRAY_SIZE of cpu->arch.gdt
Do not go beyond ARRAY_SIZE of cpu->arch.gdt Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
2644f17d6c
commit
81b79b01d0
1 changed files with 1 additions and 1 deletions
|
@ -150,7 +150,7 @@ void load_guest_gdt_entry(struct lg_cpu *cpu, u32 num, u32 lo, u32 hi)
|
|||
{
|
||||
/* We assume the Guest has the same number of GDT entries as the
|
||||
* Host, otherwise we'd have to dynamically allocate the Guest GDT. */
|
||||
if (num > ARRAY_SIZE(cpu->arch.gdt))
|
||||
if (num >= ARRAY_SIZE(cpu->arch.gdt))
|
||||
kill_guest(cpu, "too many gdt entries %i", num);
|
||||
|
||||
/* Set it up, then fix it. */
|
||||
|
|
Loading…
Reference in a new issue