mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
windows/unicode.c: tighten up a bounds check.
Coverity points out that if we refer to cp_list[codepage - 65536], we ought to have ensured that codepage - 65536 was _less_ than lenof(cp_list), not just less or equal.
This commit is contained in:
parent
1f6d93f0c8
commit
3442fb1aeb
@ -531,7 +531,7 @@ static reverse_mapping *get_reverse_mapping(int codepage)
|
||||
|
||||
if (codepage < 65536)
|
||||
return NULL;
|
||||
if (codepage > 65536 + lenof(cp_list))
|
||||
if (codepage >= 65536 + lenof(cp_list))
|
||||
return NULL;
|
||||
const struct cp_list_item *cp = &cp_list[codepage - 65536];
|
||||
if (!cp->cp_table)
|
||||
|
Loading…
Reference in New Issue
Block a user