aboutsummaryrefslogtreecommitdiff
path: root/authorize.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-03-17 14:14:56 +0100
committerDimitri Sokolyuk <demon@dim13.org>2016-03-17 14:14:56 +0100
commit0ee745919304f12dfd64a6151a40b6f5bc51d9cd (patch)
tree3c8535ead9fdcf35f96837c3f4c0f2b58865eb32 /authorize.go
parente77df0e124eab3b5ee17f1b07be6ac7d7b36bd52 (diff)
Add guard
Diffstat (limited to 'authorize.go')
-rw-r--r--authorize.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/authorize.go b/authorize.go
index e3a0837..c6ea6d6 100644
--- a/authorize.go
+++ b/authorize.go
@@ -26,6 +26,9 @@ const IdentDNS IdentType = "dns"
func (a Authorization) Supported(sols Solvers) []Challenge {
supported := func(com []int) bool {
for _, n := range com {
+ if n < 0 || n >= len(a.Challenges) {
+ return false
+ }
if _, ok := sols[a.Challenges[n].Type]; !ok {
return false
}