From b7bca0ebdc5a48c487bc4fa42e749bb23f66bca0 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 3 May 2024 22:24:44 +0900 Subject: [PATCH] win32/sspi: Fix Win32::SSPI::SSPIResult#== with Integer The values of `@@map` are `Symbol`s and `@value` should be an `Integer` since unpacked as unsigned long, so this comparison should be false always. Probably comparison with `Symbol` was intended. --- ext/win32/lib/win32/sspi.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ext/win32/lib/win32/sspi.rb b/ext/win32/lib/win32/sspi.rb index 9dbd4377a4..9407237b34 100644 --- a/ext/win32/lib/win32/sspi.rb +++ b/ext/win32/lib/win32/sspi.rb @@ -202,10 +202,13 @@ module Win32 end def ==(other) - if other.is_a?(SSPIResult) + case other + when SSPIResult @value == other.value - elsif other.is_a?(Integer) - @value == @@map[other] + when Integer + @value == other + when Symbol + @@map[@value] == other else false end