The loop that parses options has a of by one bug where the realloc
adds one byte, instead of one list element. This is exposed when
you try things like:
pgrep -t,,,,
Signed-off-by: Craig Small <csmall@enc.com.au>
if (i == size) {
size = size * 5 / 4 + 4;
/* add 1 because slot zero is a count */
- list = xrealloc (list, 1 + size * sizeof *list);
+ list = xrealloc (list, (1 + size) * sizeof *list);
}
sep_pos = strchr (ptr, ',');
if (sep_pos)