When input_id prints a decoded capability bitmap, an all-zero
bitmap can decrement the index to zero.
Check the index before reading bitmask[val - 1].
Reproducer:
udevadm test-builtin input_id with an all-zero capability mask
Follow-up:
912541b0246ef315d4d851237483b98c9dd3f992
val = bitmask_size / sizeof (unsigned long);
/* skip trailing zeros */
- while (bitmask[val-1] == 0 && val > 0)
+ while (val > 0 && bitmask[val-1] == 0)
--val;
/* IN_SET() cannot be used in assert_cc(). */