[Pcre-svn] [1714] code/trunk: Fix caseless "not" bug for wid…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [1714] code/trunk: Fix caseless "not" bug for wide character in DFA matching when UCP not defined.
Revision: 1714
          http://vcs.pcre.org/viewvc?view=rev&revision=1714
Author:   ph10
Date:     2017-11-16 18:00:54 +0000 (Thu, 16 Nov 2017)
Log Message:
-----------
Fix caseless "not" bug for wide character in DFA matching when UCP not defined.


Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/pcre_dfa_exec.c


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2017-10-22 16:19:42 UTC (rev 1713)
+++ code/trunk/ChangeLog    2017-11-16 18:00:54 UTC (rev 1714)
@@ -16,7 +16,12 @@
 path names to 512 characters. There is now a check on the absolute length of
 full path file names, which may be up to 2047 characters long.


+4. Using pcre_dfa_exec(), in UTF mode when UCP support was not defined, there
+was the possibility of a false positive match when caselessly matching a "not
+this character" item such as [^\x{1234}] (with a code point greater than 127)
+because the "other case" variable was not being initialized.

+
Version 8.41 05-July-2017
-------------------------


Modified: code/trunk/pcre_dfa_exec.c
===================================================================
--- code/trunk/pcre_dfa_exec.c    2017-10-22 16:19:42 UTC (rev 1713)
+++ code/trunk/pcre_dfa_exec.c    2017-11-16 18:00:54 UTC (rev 1714)
@@ -2287,12 +2287,14 @@
       case OP_NOTI:
       if (clen > 0)
         {
-        unsigned int otherd;
+        pcre_uint32 otherd;
 #ifdef SUPPORT_UTF
         if (utf && d >= 128)
           {
 #ifdef SUPPORT_UCP
           otherd = UCD_OTHERCASE(d);
+#else
+          otherd = d;
 #endif  /* SUPPORT_UCP */
           }
         else