Revision: 426
http://www.exim.org/viewvc/pcre2?view=rev&revision=426
Author: ph10
Date: 2015-11-11 17:52:11 +0000 (Wed, 11 Nov 2015)
Log Message:
-----------
Check errorcode > 0 in regerror().
Modified Paths:
--------------
code/trunk/ChangeLog
code/trunk/src/pcre2posix.c
Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog 2015-11-11 17:43:37 UTC (rev 425)
+++ code/trunk/ChangeLog 2015-11-11 17:52:11 UTC (rev 426)
@@ -286,7 +286,9 @@
83. Lock out configuring for EBCDIC with non-8-bit libraries.
+84. Test for error code <= 0 in regerror().
+
Version 10.20 30-June-2015
--------------------------
Modified: code/trunk/src/pcre2posix.c
===================================================================
--- code/trunk/src/pcre2posix.c 2015-11-11 17:43:37 UTC (rev 425)
+++ code/trunk/src/pcre2posix.c 2015-11-11 17:52:11 UTC (rev 426)
@@ -147,7 +147,7 @@
int used;
const char *message;
-message = (errcode >= (int)(sizeof(pstring)/sizeof(char *)))?
+message = (errcode <= 0 || errcode >= (int)(sizeof(pstring)/sizeof(char *)))?
"unknown error code" : pstring[errcode];
if (preg != NULL && (int)preg->re_erroffset != -1)