+ fix: Onigmo RegEx: fixing possible crash

This commit is contained in:
Rainer Kottenhoff 2019-01-31 17:29:33 +01:00
parent f78cb05d39
commit cf72b7b8da

View File

@ -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;