]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
regex: initialize all variables in regex_compile(), fixes #4415
authorJaroslav Kysela <perex@perex.cz>
Wed, 7 Jun 2017 06:36:11 +0000 (08:36 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 7 Jun 2017 06:36:11 +0000 (08:36 +0200)
src/wrappers.c

index 39e9b97168be009924f3e4d7c4a48951c0ab1e9b..871b6c80c91c6b0783dd12926552913af07dd82d 100644 (file)
@@ -427,6 +427,10 @@ int regex_compile(tvh_regex_t *regex, const char *re_str, int subsys)
 #if ENABLE_PCRE
   const char *estr;
   int eoff;
+#if PCRE_STUDY_JIT_COMPILE
+  regex->re_jit_stack = NULL;
+#endif
+  regex->re_extra = NULL;
   regex->re_code = pcre_compile(re_str, PCRE_CASELESS | PCRE_UTF8,
                                 &estr, &eoff, NULL);
   if (regex->re_code == NULL) {
@@ -452,6 +456,8 @@ int regex_compile(tvh_regex_t *regex, const char *re_str, int subsys)
   PCRE2_SIZE eoff;
   size_t jsz;
   assert(regex->re_jit_stack == NULL);
+  regex->re_jit_stack = NULL;
+  regex->re_match = NULL;
   regex->re_mcontext = pcre2_match_context_create(NULL);
   regex->re_code = pcre2_compile((PCRE2_SPTR8)re_str, -1,
                                  PCRE2_CASELESS | PCRE2_UTF,