[Pcre-svn] [1685] code/trunk: Check character < 256 for ispr…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [1685] code/trunk: Check character < 256 for isprint() in pcretest.
Revision: 1685
          http://vcs.pcre.org/viewvc?view=rev&revision=1685
Author:   ph10
Date:     2017-02-22 17:37:47 +0000 (Wed, 22 Feb 2017)
Log Message:
-----------
Check character < 256 for isprint() in pcretest.


Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/pcretest.c
    code/trunk/testdata/testinput15
    code/trunk/testdata/testoutput15


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2017-02-22 17:17:49 UTC (rev 1684)
+++ code/trunk/ChangeLog    2017-02-22 17:37:47 UTC (rev 1685)
@@ -23,7 +23,9 @@
 5.  Avoid use of a potentially overflowing buffer in pcregrep (patch by Petr 
 Pisar).


+6. Check for values < 256 when calling isprint() in pcretest.

+
Version 8.40 11-January-2017
----------------------------


Modified: code/trunk/pcretest.c
===================================================================
--- code/trunk/pcretest.c    2017-02-22 17:17:49 UTC (rev 1684)
+++ code/trunk/pcretest.c    2017-02-22 17:37:47 UTC (rev 1685)
@@ -177,7 +177,7 @@
 #define PRINTABLE(c) ((c) >= 32 && (c) < 127)
 #endif


-#define PRINTOK(c) (locale_set? isprint(c) : PRINTABLE(c))
+#define PRINTOK(c) (locale_set? (((c) < 256) && isprint(c)) : PRINTABLE(c))

/* Posix support is disabled in 16 or 32 bit only mode. */
#if !defined SUPPORT_PCRE8 && !defined NOPOSIX

Modified: code/trunk/testdata/testinput15
===================================================================
--- code/trunk/testdata/testinput15    2017-02-22 17:17:49 UTC (rev 1684)
+++ code/trunk/testdata/testinput15    2017-02-22 17:37:47 UTC (rev 1685)
@@ -363,4 +363,7 @@


/abc/89

+//8+L
+    \xf1\xad\xae\xae
+
 /-- End of testinput15 --/


Modified: code/trunk/testdata/testoutput15
===================================================================
--- code/trunk/testdata/testoutput15    2017-02-22 17:17:49 UTC (rev 1684)
+++ code/trunk/testdata/testoutput15    2017-02-22 17:37:47 UTC (rev 1685)
@@ -1136,4 +1136,9 @@
 /abc/89
 Failed: setting UTF is disabled by the application at offset 0


+//8+L
+    \xf1\xad\xae\xae
+ 0: 
+ 0+ \x{6dbae}
+
 /-- End of testinput15 --/