summary refs log tree commit diff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2019-02-28 17:31:13 +0100
committerLeah Neukirchen <leah@vuxu.org>2019-02-28 17:34:58 +0100
commitc8ce6d220c41cfc8fbeb6340f2264c1af4d5e264 (patch)
tree45f7d26b21a2f3615ed562db8650d556ed536bc4
parent74d8393fdf3995fb6181f5005ead69a656836c92 (diff)
downloadmblaze-c8ce6d220c41cfc8fbeb6340f2264c1af4d5e264.tar.gz
mblaze-c8ce6d220c41cfc8fbeb6340f2264c1af4d5e264.tar.xz
mblaze-c8ce6d220c41cfc8fbeb6340f2264c1af4d5e264.zip
magrep: fix use of uninitialized memory
found by -fsanitize=memory
-rw-r--r--magrep.c2
1 files changed, 1 insertions, 1 deletions
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) {