summaryrefslogtreecommitdiffstats
path: root/generic/regguts.h
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-04-08 19:45:55 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-04-08 19:45:55 (GMT)
commite62eab9118e1460d3afe28e01dc2b83bbb63194c (patch)
tree88b8c204f46260baa9bc76dda0d1b56189e75472 /generic/regguts.h
parent84d7d75f97cf88a8414d4b9832487567cfaf2bd4 (diff)
parentf637643facaa33834a74333f56971933a2158176 (diff)
downloadtcl-e62eab9118e1460d3afe28e01dc2b83bbb63194c.zip
tcl-e62eab9118e1460d3afe28e01dc2b83bbb63194c.tar.gz
tcl-e62eab9118e1460d3afe28e01dc2b83bbb63194c.tar.bz2
3610026 Stop crash when the number of "colors" in a regular expression
overflows a short int. Thanks to Heikki Linnakangas for the report and the patch.
Diffstat (limited to 'generic/regguts.h')
-rw-r--r--generic/regguts.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/generic/regguts.h b/generic/regguts.h
index c77a8fc..ee5c596 100644
--- a/generic/regguts.h
+++ b/generic/regguts.h
@@ -174,6 +174,7 @@
*/
typedef short color; /* colors of characters */
typedef int pcolor; /* what color promotes to */
+#define MAX_COLOR SHRT_MAX /* max color value */
#define COLORLESS (-1) /* impossible color */
#define WHITE 0 /* default color, parent of all others */