Skip to content

Commit

Permalink
lguest: beyond ARRAY_SIZE of cpu->arch.gdt
Browse files Browse the repository at this point in the history
Do not go beyond ARRAY_SIZE of cpu->arch.gdt

Signed-off-by: Roel Kluin <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
RoelKluin authored and rustyrussell committed Jun 12, 2009
1 parent 2644f17 commit 81b79b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/lguest/segments.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit 81b79b0

Please sign in to comment.