From dd0ede9741811ecd8ea9b9b952fb5073f2cfabfa Mon Sep 17 00:00:00 2001 From: Dave Grijalva Date: Fri, 13 Nov 2015 12:50:04 -0800 Subject: [PATCH] fix array OOB panic (#100) --- cmd/jwt/app.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/jwt/app.go b/cmd/jwt/app.go index 75db9d2..a78d81a 100644 --- a/cmd/jwt/app.go +++ b/cmd/jwt/app.go @@ -205,5 +205,8 @@ func signToken() error { } func isEs() bool { - return (*flagAlg)[0:2] == "ES" + if alg := *flagAlg; len(alg) >= 2 && alg[0:2] == "ES" { + return true + } + return false }