Skip to content

Commit

Permalink
Check arguments length before reading
Browse files Browse the repository at this point in the history
fix

```
panic: runtime error: index out of range [1] with length 1

goroutine 1 [running]:
main.getQuestion()
        /build/dnslookup/parts/dnslookup/build/main.go:239 +0x147
main.main()
        /build/dnslookup/parts/dnslookup/build/main.go:44 +0x145
```

Revert "Check arguments length before reading"

This reverts commit 4bc0a24.

Update main.go
  • Loading branch information
Howard20181 committed Jun 21, 2024
1 parent cbebc1e commit 6ce151b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ func main() {
do := os.Getenv("DNSSEC") == "1"
subnetOpt := getSubnet()
ednsOpt := getEDNSOpt()
question := getQuestion()

if verbose {
log.SetLevel(log.DEBUG)
Expand Down Expand Up @@ -72,6 +71,8 @@ func main() {
os.Exit(1)
}

question := getQuestion()

if timeoutStr != "" {
i, err := strconv.Atoi(timeoutStr)
if err != nil {
Expand Down

0 comments on commit 6ce151b

Please sign in to comment.