xpm - colors cant be 96 bytes long.

since colors are hex, 96 bytes of hex would be 32bytes per r, g and b,
and that would be 128 bits per  r g and b and that just is never seen
or used. also coverity is right in CID 1193201 that we just can't
shift that many, so go down to max 16 bits per rgb which is sensible
and able to be done. (thats 12 bytes max for hex of color).
This commit is contained in:
Carsten Haitzler 2014-08-14 17:34:39 +09:00
parent caf2b018a2
commit 49694c9a64
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ xpm_parse_color(char *color, int *r, int *g, int *b)
int len;
len = strlen(color) - 1;
if (len < 96)
if (len < 13)
{
len /= 3;