commit 6a2d066e3fd7520bbb266712bc24b51ba88ac55e
parent 420a4d7c62563b19e61e42e350ec3bb636cc281b
Author: ukai <ukai>
Date: Tue, 15 Jan 2002 18:26:13 +0000
[w3m-dev 02845]
* regex.c (newRegex0): check regex->storage[STORAGE_MAX]
From: Fumitoshi UKAI <ukai@debian.or.jp>
Diffstat:
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,8 @@
+2002-01-16 Fumitoshi UKAI <ukai@debian.or.jp>
+
+ * [w3m-dev 02845]
+ * regex.c (newRegex0): check regex->storage[STORAGE_MAX]
+
2002-01-16 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
* [w3m-dev 02843] w3mmail.cgi.in update
diff --git a/regex.c b/regex.c
@@ -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 >= ®ex->storage[STORAGE_MAX])
+ *msg = "Regular expression too long";
+ return NULL;
}
*(st_ptr++) = '\0';
re->p.pattern = r;