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:
Luiz Otavio O Souza 2015-05-13 02:25:54 +00:00
parent 98d1292d0a
commit ee0f1e8e43
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=282829

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);