From cf72b7b8dabbada75d75e9f142f0e85e58c52cc3 Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Thu, 31 Jan 2019 17:29:33 +0100 Subject: [PATCH] + fix: Onigmo RegEx: fixing possible crash --- onigmo/regcomp.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/onigmo/regcomp.c b/onigmo/regcomp.c index 8d8631dc0..07ef36974 100644 --- a/onigmo/regcomp.c +++ b/onigmo/regcomp.c @@ -5824,6 +5824,12 @@ onig_reg_init(regex_t* reg, OnigOptionType option, if (IS_NULL(reg)) return ONIGERR_INVALID_ARGUMENT; + (reg)->exact = (UChar* )NULL; + (reg)->chain = (regex_t* )NULL; + (reg)->p = (UChar* )NULL; + (reg)->name_table = (void* )NULL; + (reg)->repeat_range = (OnigRepeatRange* )NULL; + if (ONIGENC_IS_UNDEF(enc)) return ONIGERR_DEFAULT_ENCODING_IS_NOT_SET; @@ -5843,13 +5849,9 @@ onig_reg_init(regex_t* reg, OnigOptionType option, (reg)->options = option; (reg)->syntax = syntax; (reg)->optimize = 0; - (reg)->exact = (UChar* )NULL; - (reg)->chain = (regex_t* )NULL; - (reg)->p = (UChar* )NULL; (reg)->alloc = 0; (reg)->used = 0; - (reg)->name_table = (void* )NULL; (reg)->case_fold_flag = case_fold_flag; return 0;