A patch containing the following miscellaneous tweaks:
. make a supposedly robust parameter test truly robust
[ ensure the largest enum value used with validation ]
. remove duplicate item test in cleanup_stack function
[ is already subordinate to test of PROCPS_PIDS_noop ]
Signed-off-by: Jim Warner <james.warner@comcast.net>
if (p->item < PROCPS_PIDS_noop) {
if (Item_table[p->item].freefunc)
Item_table[p->item].freefunc(p);
- if (p->item < PROCPS_PIDS_noop)
- p->result.ull_int = 0;
+ p->result.ull_int = 0;
}
++p;
}
* ^~~~~~~~~~~~~~~~
*/
if (maxitems < 1
- || (void *)items < (void *)PROCPS_PIDS_physical_end)
+ || (void *)items < (void *)0x8000) // twice as big as our largest enum
return -1;
for (i = 0; i < maxitems; i++) {
// a pids_item is currently unsigned, but we'll protect our future