1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Correct an inequality sign causing the bounds check in Windows

palette_set() to be bogus. Fortunately, this isn't exploitable through
the terminal emulator, because the palette escape sequence parser
contains its own bounds check before even calling palette_set().

While I'm at it, fix the same goof in the OS X version! That port is
more or less abandoned, but that's no excuse for leaving obviously
wrong code lying around.

[originally from svn r9965]
This commit is contained in:
Simon Tatham 2013-07-22 07:12:26 +00:00
parent b3afa10aa7
commit 81a11efdaf
2 changed files with 2 additions and 2 deletions

View File

@ -957,7 +957,7 @@ void palette_set(void *frontend, int n, int r, int g, int b)
if (n >= 16)
n += 256 - 16;
if (n > NALLCOLOURS)
if (n >= NALLCOLOURS)
return;
[win setColour:n r:r/255.0 g:g/255.0 b:b/255.0];

View File

@ -4805,7 +4805,7 @@ void palette_set(void *frontend, int n, int r, int g, int b)
{
if (n >= 16)
n += 256 - 16;
if (n > NALLCOLOURS)
if (n >= NALLCOLOURS)
return;
real_palette_set(n, r, g, b);
if (pal) {