From: K.Kosako Date: Tue, 10 Apr 2018 00:00:54 +0000 (+0900) Subject: fix #87: Read unknown address in onig_error_code_to_str() X-Git-Tag: v6.8.2^2~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=410f5916429e7d2920e1d4867388514f605413b8;p=onig fix #87: Read unknown address in onig_error_code_to_str() --- diff --git a/src/regcomp.c b/src/regcomp.c index afce4db..45d4acf 100644 --- a/src/regcomp.c +++ b/src/regcomp.c @@ -5979,7 +5979,10 @@ onig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end, #endif root = 0; - if (IS_NOT_NULL(einfo)) einfo->par = (UChar* )NULL; + if (IS_NOT_NULL(einfo)) { + einfo->enc = reg->enc; + einfo->par = (UChar* )NULL; + } #ifdef ONIG_DEBUG print_enc_string(stderr, reg->enc, pattern, pattern_end); @@ -6124,7 +6127,6 @@ onig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end, err: if (IS_NOT_NULL(scan_env.error)) { if (IS_NOT_NULL(einfo)) { - einfo->enc = scan_env.enc; einfo->par = scan_env.error; einfo->par_end = scan_env.error_end; }