The standThreshold
for the dealer in the call
function is calculated in a way that could produce values outside of the desired range of 17 to 21.
The value of standThreshold
is derived from a random number, but there is no explicit check to ensure that it falls within the range of 17 to 21. The calculation could result in values that are either too low (below 17) or too high (above 21), which would break standard blackjack rules.
The dealer could be forced to stand at an invalid threshold, causing an unfair game outcome where the dealer either stands too early or keeps drawing cards unnecessarily.
Manual Code Review
Ensure that the standThreshold
is always constrained between 17 and 21. You can adjust the logic to explicitly check for this range before the dealer acts.
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.