Skip to content

Commit 2579791

Browse files
committed
fix examples
1 parent 7d36c23 commit 2579791

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

go/ql/src/experimental/CWE-321-V2/Example.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1+
package main
12

3+
import (
4+
"fmt"
5+
"log"
6+
)
27

38
var JwtKey = []byte("AllYourBase")
49

510
func main() {
6-
// BAD: usage of a harcoded Key
11+
// BAD: usage of a harcoded Key
712
verifyJWT(token)
813
}
914

@@ -18,4 +23,4 @@ func verifyJWT(signedToken string) {
1823
} else {
1924
log.Fatal(err)
2025
}
21-
}
26+
}

go/ql/src/experimental/CWE-347/Example.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
package main
12

2-
3+
import (
4+
"fmt"
5+
"log"
6+
)
37

48
func main() {
59
// BAD: only decode jwt without verification
@@ -30,4 +34,4 @@ func verifyJWT(signedToken string) {
3034
} else {
3135
log.Fatal(err)
3236
}
33-
}
37+
}

0 commit comments

Comments
 (0)