summaryrefslogtreecommitdiffstats
path: root/xlib/xcolors.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlib/xcolors.c')
-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);