diff --git a/ChangeLog b/ChangeLog index cf58f42..fb60852 100644 --- a/ChangeLog +++ b/ChangeLog @@ -73,6 +73,9 @@ or deserialization (the "load" or "save" commands). 11. Fix memory leak in pcre2_serialize_decode() when the input is invalid. +12. Fix potential NULL dereference in pcre2_callout_enumerate() if called with +a NULL pattern pointer when Unicode support is available. + Version 10.23 14-February-2017 ------------------------------ diff --git a/src/pcre2_pattern_info.c b/src/pcre2_pattern_info.c index 0392a0b..5dd8ac5 100644 --- a/src/pcre2_pattern_info.c +++ b/src/pcre2_pattern_info.c @@ -261,11 +261,15 @@ pcre2_real_code *re = (pcre2_real_code *)code; pcre2_callout_enumerate_block cb; PCRE2_SPTR cc; #ifdef SUPPORT_UNICODE -BOOL utf = (re->overall_options & PCRE2_UTF) != 0; +BOOL utf; #endif if (re == NULL) return PCRE2_ERROR_NULL; +#ifdef SUPPORT_UNICODE +utf = (re->overall_options & PCRE2_UTF) != 0; +#endif + /* Check that the first field in the block is the magic number. If it is not, return with PCRE2_ERROR_BADMAGIC. */