mirror of
https://github.com/github/codeql.git
synced 2026-02-27 20:33:42 +01:00
18 lines
262 B
Go
18 lines
262 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
func user(input string) {
|
|
|
|
ptr, err := os.Open(input)
|
|
// BAD: ptr is dereferenced before either it or `err` has been checked.
|
|
fmt.Printf("Opened %v\n", *ptr)
|
|
if err != nil {
|
|
fmt.Printf("Bad input: %s\n", input)
|
|
}
|
|
|
|
}
|