chiark / gitweb /
Merge from existing archive branch
[pcre3.git] / pcreposix.c
index ed506197a53521737ff0fa379f9f21c6d8aa4dfc..cf75588c40d7984d9b622faa393ba49c760bacb6 100644 (file)
@@ -6,7 +6,7 @@
 and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
-           Copyright (c) 1997-2014 University of Cambridge
+           Copyright (c) 1997-2016 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -172,7 +172,9 @@ static const int eint[] = {
   REG_BADPAT,  /* invalid range in character class */
   REG_BADPAT,  /* group name must start with a non-digit */
   /* 85 */
-  REG_BADPAT   /* parentheses too deeply nested (stack check) */
+  REG_BADPAT,  /* parentheses too deeply nested (stack check) */
+  REG_BADPAT,  /* missing digits in \x{} or \o{} */
+  REG_BADPAT   /* pattern too complicated */
 };
 
 /* Table of texts corresponding to POSIX error codes */
@@ -363,6 +365,7 @@ start location rather than being passed as a PCRE "starting offset". */
 
 if ((eflags & REG_STARTEND) != 0)
   {
+  if (pmatch == NULL) return REG_INVARG;
   so = pmatch[0].rm_so;
   eo = pmatch[0].rm_eo;
   }