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 | f316411ab53090e608f187721f6f1c96e1d0676d (patch) | |
tree | 067670917edc8bd8528aae53827de487a096cbde /xlib | |
parent | 23603dd6dc997924d2fe1dd25fd17422d5645fbd (diff) | |
download | tk-f316411ab53090e608f187721f6f1c96e1d0676d.zip tk-f316411ab53090e608f187721f6f1c96e1d0676d.tar.gz tk-f316411ab53090e608f187721f6f1c96e1d0676d.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); |