Skip to content

Commit e01929b

Browse files
committed
add check for uint16 bounds
1 parent e557016 commit e01929b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/file/azure.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package file
33
import (
44
"context"
55
"fmt"
6+
"math"
67
"math/rand"
78
"net/url"
89
"os"
@@ -62,7 +63,11 @@ func newAzureFile(c *AzureConfig, filename string, mode Mode) (*azure, error) {
6263
return nil, err
6364
}
6465

65-
azFile.parallelism = uint16(pl)
66+
if pl>=0 && pl<= math.MaxUint16{
67+
azFile.parallelism = uint16(pl)
68+
} else {
69+
azFile.parallelism = uint16(0)
70+
}
6671
}
6772

6873
return azFile, nil

0 commit comments

Comments
 (0)