aboutsummaryrefslogtreecommitdiffstats
path: root/regex.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-01-15 18:26:13 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-01-15 18:26:13 +0000
commitc601731fb614db8728a6fbf338efe7ef95e1206e (patch)
tree7e2a0e5c4c5d43773460a4e2c96e2494220d898a /regex.c
parent[w3m-dev 02843] w3mmail.cgi.in update (diff)
downloadw3m-c601731fb614db8728a6fbf338efe7ef95e1206e.tar.gz
w3m-c601731fb614db8728a6fbf338efe7ef95e1206e.zip
[w3m-dev 02845]
* regex.c (newRegex0): check regex->storage[STORAGE_MAX] From: Fumitoshi UKAI <ukai@debian.or.jp>
Diffstat (limited to 'regex.c')
-rw-r--r--regex.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/regex.c b/regex.c
index 4795f24..6135f20 100644
--- a/regex.c
+++ b/regex.c
@@ -1,4 +1,4 @@
-/* $Id: regex.c,v 1.10 2002/01/11 02:24:13 a-ito Exp $ */
+/* $Id: regex.c,v 1.11 2002/01/15 18:26:13 ukai Exp $ */
/*
* regex: Regular expression pattern match library
*
@@ -172,6 +172,9 @@ newRegex0(char **ex, int igncase, Regex *regex, char **msg, int level)
#endif
else
*(st_ptr++) = (unsigned char)*(p++);
+ if (st_ptr >= &regex->storage[STORAGE_MAX])
+ *msg = "Regular expression too long";
+ return NULL;
}
*(st_ptr++) = '\0';
re->p.pattern = r;