Fix the vmstat -i output on ARM.

The consumers of hw.intrnames expect a NULL byte at end of the string
containing the interrupt names.

On ARM all the interrupt name slots are initialized and this leave no room
for the terminating NULL byte, which makes vmstat read beyond the end of
intrnames.

PR:		199891
Tested on:	RPi 2 and BeagleBone Black
This commit is contained in:
loos 2015-05-13 02:25:54 +00:00
parent e5dea16a76
commit 1aadf4978f

View File

@ -78,7 +78,7 @@ int (*arm_config_irq)(int irq, enum intr_trigger trig,
/* Data for statistics reporting. */
u_long intrcnt[NIRQ];
char intrnames[NIRQ * INTRNAME_LEN];
char intrnames[(NIRQ * INTRNAME_LEN) + 1];
size_t sintrcnt = sizeof(intrcnt);
size_t sintrnames = sizeof(intrnames);