From: Filipe Brandenburger Date: Mon, 11 May 2015 18:40:50 +0000 (-0700) Subject: pgrep: prevent buffer overflow in opts X-Git-Tag: v3.3.11~53 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e566680254c81da686149a5b996c35f6e412281c;p=procps-ng pgrep: prevent buffer overflow in opts Recent commit 9742c74e7c522 ("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 --- diff --git a/pgrep.c b/pgrep.c index 27b7e893..bd25eaa0 100644 --- a/pgrep.c +++ b/pgrep.c @@ -677,7 +677,7 @@ static int signal_option(int *argc, char **argv) static void parse_opts (int argc, char **argv) { - char opts[32] = ""; + char opts[64] = ""; int opt; int criteria_count = 0;