mirror of
https://github.com/pushbits/server.git
synced 2025-07-30 06:39:13 +02:00
Address CWE-703 in hibp.go
This commit is contained in:
parent
ead4f364f7
commit
64563989b5
1 changed files with 5 additions and 1 deletions
|
@ -39,12 +39,16 @@ func IsPasswordPwned(password string) (bool, error) {
|
|||
log.L.Fatalf("Request failed with HTTP %s.", resp.Status)
|
||||
}
|
||||
|
||||
defer resp.Body.Close()
|
||||
bodyText, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
log.L.Fatal(err)
|
||||
}
|
||||
|
||||
err = resp.Body.Close()
|
||||
if err != nil {
|
||||
log.L.Warnf("Failed to close file: %s.", err)
|
||||
}
|
||||
|
||||
bodyStr := string(bodyText)
|
||||
lines := strings.Split(bodyStr, "\n")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue