diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-04-13 12:45:44 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-04-13 12:45:44 (GMT) |
commit | 9642f18455a827c21c138dd799c26badbd641c34 (patch) | |
tree | 067670917edc8bd8528aae53827de487a096cbde /xlib | |
parent | 9699b942e96cabd5fe1e5047d65b0d1e856c140c (diff) | |
download | tk-9642f18455a827c21c138dd799c26badbd641c34.zip tk-9642f18455a827c21c138dd799c26badbd641c34.tar.gz tk-9642f18455a827c21c138dd799c26badbd641c34.tar.bz2 |
(cherry-pick): Fixed bug [f0188aca9e] (color names parsing on Windows), by Simon Bachmann
Diffstat (limited to 'xlib')
-rw-r--r-- | xlib/xcolors.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/xlib/xcolors.c b/xlib/xcolors.c index 66591c7..7b7223c 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); |