diff options
author | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2015-11-11 17:52:11 +0000 |
---|---|---|
committer | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2015-11-11 17:52:11 +0000 |
commit | 6e492da2e2a550d74670a8dea0e701a4588ed0c8 (patch) | |
tree | 3656c11bd3c6f3d4aa0544195f7e27b88f87cf0f /src/pcre2posix.c | |
parent | 618318f1a9f7c34fcea7a0b8b8d069da7192ab80 (diff) | |
download | pcre2-6e492da2e2a550d74670a8dea0e701a4588ed0c8.tar.gz |
Check errorcode > 0 in regerror().
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@426 6239d852-aaf2-0410-a92c-79f79f948069
Diffstat (limited to 'src/pcre2posix.c')
-rw-r--r-- | src/pcre2posix.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pcre2posix.c b/src/pcre2posix.c index 134a0c1..2792c17 100644 --- a/src/pcre2posix.c +++ b/src/pcre2posix.c @@ -147,7 +147,7 @@ regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size) 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) |