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:
parent
b3afa10aa7
commit
81a11efdaf
@ -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];
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user