pgrep: prevent buffer overflow in opts

Recent commit 9742c74e7c ("pgrep: Enable case-insensitive process matching")
caused the "opts" string to overflow the show 32-character space allocated for
it.

Bump it up to 64 bytes, which should be enough even if more options are added.

Tested: Running ./pgrep stopped crashing and `make check` passed.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
This commit is contained in:
Filipe Brandenburger 2015-05-11 11:40:50 -07:00 committed by Craig Small
parent 2753a8f3db
commit e566680254

View File

@ -677,7 +677,7 @@ static int signal_option(int *argc, char **argv)
static void parse_opts (int argc, char **argv) static void parse_opts (int argc, char **argv)
{ {
char opts[32] = ""; char opts[64] = "";
int opt; int opt;
int criteria_count = 0; int criteria_count = 0;