Merge pull request #950 from projectdiscovery/933-bugfix-dsl-number-conversion

Fixing wrong type conversion in DSL helper
dev
Sandeep Singh 2021-08-17 16:33:58 +05:30 committed by GitHub
commit 0ab66782e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -220,10 +220,10 @@ var functions = map[string]govaluate.ExpressionFunction{
max := math.MaxInt32
if len(args) >= 1 {
min = args[0].(int)
min = int(args[0].(float64))
}
if len(args) >= withMaxRandArgsSize {
max = args[1].(int)
max = int(args[1].(float64))
}
return rand.Intn(max-min) + min, nil
},