Re: [Qemu-devel] [PATCH] pseries: Fix possible out-of-bounds error

2011-11-28 Thread Stefan Weil
Am 21.11.2011 20:25, schrieb Stefan Weil: PCI_NUM_REGIONS is 7, ARRAY_SIZE(bars) is 6. Either bars must be extended by a 7th array element, or the loop which reads bars[i] must terminate before it tries to read bars[6]. For dev-io_regions[6].size == 0, the old code also works, but it is not

Re: [Qemu-devel] [PATCH] pseries: Fix possible out-of-bounds error

2011-11-28 Thread David Gibson
On Mon, Nov 28, 2011 at 06:53:33PM +0100, Stefan Weil wrote: Am 21.11.2011 20:25, schrieb Stefan Weil: PCI_NUM_REGIONS is 7, ARRAY_SIZE(bars) is 6. Either bars must be extended by a 7th array element, or the loop which reads bars[i] must terminate before it tries to read bars[6]. For

[Qemu-devel] [PATCH] pseries: Fix possible out-of-bounds error

2011-11-21 Thread Stefan Weil
PCI_NUM_REGIONS is 7, ARRAY_SIZE(bars) is 6. Either bars must be extended by a 7th array element, or the loop which reads bars[i] must terminate before it tries to read bars[6]. For dev-io_regions[6].size == 0, the old code also works, but it is not obvious whether this is always true. This bug