From 7c7caf5eecaa25d5dbfee3960f7d2bd350b65d9e Mon Sep 17 00:00:00 2001 From: samr7 Date: Wed, 4 Jul 2012 08:57:27 -0700 Subject: [PATCH] Initialize search context before use. --- pattern.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pattern.c b/pattern.c index d954adc..012ec21 100644 --- a/pattern.c +++ b/pattern.c @@ -1781,6 +1781,7 @@ vg_prefix_context_new(int addrtype, int privtype, int caseinsensitive) vcpp = (vg_prefix_context_t *) malloc(sizeof(*vcpp)); if (vcpp) { + memset(vcpp, 0, sizeof(*vcpp)); vcpp->base.vc_addrtype = addrtype; vcpp->base.vc_privtype = privtype; vcpp->base.vc_npatterns = 0; @@ -2022,6 +2023,7 @@ vg_regex_context_new(int addrtype, int privtype) vcrp = (vg_regex_context_t *) malloc(sizeof(*vcrp)); if (vcrp) { + memset(vcrp, 0, sizeof(*vcrp)); vcrp->base.vc_addrtype = addrtype; vcrp->base.vc_privtype = privtype; vcrp->base.vc_npatterns = 0;