From c8ce6d220c41cfc8fbeb6340f2264c1af4d5e264 Mon Sep 17 00:00:00 2001 From: Duncaen Date: Thu, 28 Feb 2019 17:31:13 +0100 Subject: magrep: fix use of uninitialized memory found by -fsanitize=memory --- magrep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'magrep.c') diff --git a/magrep.c b/magrep.c index 7fad9e1..8cb3d1f 100644 --- a/magrep.c +++ b/magrep.c @@ -32,7 +32,7 @@ int match(char *file, char *hdr, char *s) { if (oflag && !cflag && !qflag && !vflag && !lflag) { - regmatch_t pmatch; + regmatch_t pmatch = {0}; int len, matched; matched = 0; while (*s && regexec(&pattern, s, 1, &pmatch, 0) == 0) { -- cgit 1.4.1