[PATCH 0/1] MR4765: bcrypt: Fix an possible out-of-bounds read (Coverity).
From: Zhiyi Zhang <zzhang(a)codeweavers.com> --- dlls/bcrypt/bcrypt_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c index 26472cbfe2b..52066a32c74 100644 --- a/dlls/bcrypt/bcrypt_main.c +++ b/dlls/bcrypt/bcrypt_main.c @@ -272,7 +272,7 @@ static struct object *get_object( BCRYPT_HANDLE handle, ULONG magic ) } idx = (ULONG_PTR)handle >> 4; - if (idx > ARRAY_SIZE(pseudo_algorithms) || !pseudo_algorithms[idx].hdr.magic) + if (idx >= ARRAY_SIZE(pseudo_algorithms) || !pseudo_algorithms[idx].hdr.magic) { FIXME( "pseudo-handle %p not supported\n", handle ); return NULL; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/4765
This merge request was approved by Hans Leidekker. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/4765
participants (3)
-
Hans Leidekker (@hans) -
Zhiyi Zhang -
Zhiyi Zhang (@zhiyi)