Commit 87231e2c authored by Chong Yidong's avatar Chong Yidong
Browse files

Fix buffer overflow in ns_get_color.

* nsterm.m (ns_get_color): Fix buffer overflow (Bug#4763).
parent bd0948ca
2010-01-01 Chong Yidong <cyd@stupidchicken.com>
* nsterm.m (ns_get_color): Fix buffer overflow (Bug#4763).
* lread.c (syms_of_lread): Make it clearer that these are the
names of loaded files (Bug#5068).
......
......@@ -1346,7 +1346,8 @@ Free a pool and temporary objects it refers to (callable from C)
}
else if (!strncmp(name, "rgb:", 4)) /* A newer X11 format -- rgb:r/g/b */
{
strcpy(hex, name + 4);
strncpy (hex, name + 4, 19);
hex[19] = '\0';
scaling = (strlen(hex) - 2) / 3;
}
else if (name[0] == '#') /* An old X11 format; convert to newer */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment