summaryrefslogtreecommitdiffstats
path: root/xlib
diff options
context:
space:
mode:
authorsimonbachmann <simonbachmann@bluewin.ch>2017-04-08 07:17:12 (GMT)
committersimonbachmann <simonbachmann@bluewin.ch>2017-04-08 07:17:12 (GMT)
commit735fd7e290750c83ddd6d0e1db7e1511c306936b (patch)
tree934324fa7343dd2b442561ca9b50bdef478baeac /xlib
parent363b4f5da3ca7631595eae18ba0490364c3680ad (diff)
downloadtk-735fd7e290750c83ddd6d0e1db7e1511c306936b.zip
tk-735fd7e290750c83ddd6d0e1db7e1511c306936b.tar.gz
tk-735fd7e290750c83ddd6d0e1db7e1511c306936b.tar.bz2
Fixed bug [f0188aca9e] (color names parsing on Windows)
Diffstat (limited to 'xlib')
-rw-r--r--xlib/xcolors.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/xlib/xcolors.c b/xlib/xcolors.c
index b5e45c9..36dc67c 100644
--- a/xlib/xcolors.c
+++ b/xlib/xcolors.c
@@ -345,6 +345,16 @@ XParseColor(
char *p;
Tcl_WideInt value = parseHex64bit(++spec, &p);
+ /*
+ * If *p does not point to the end of the string, there were invalid
+ * digits in the spec. Ergo, it is not a vailid color string.
+ * (Bug f0188aca9e)
+ */
+
+ if (*p != '\0') {
+ return 0;
+ }
+
switch ((int)(p-spec)) {
case 3:
colorPtr->red = US(((value >> 8) & 0xf) * 0x1111);