Description
In the TwentyOne::dealersHand
function, the condition evaluated in the if statement in L:47 doesn't count the case when cardValue
is equal to zero as the TwentyOne::playersHand
does.
Impact
In this case when cardValue
is equal to zero, the value of 0
will be added to the dealerTotal
variable. This will result in an incorrect value assigned, since the correct value added to dealerTotal
should be 10, due to when cardValue
is equal to zero, it represents the case where a K
card is given to the dealer.
Recommended mitigation
Change the logic to the same inside TwentyOne::playersHand
function.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.