Update some nits

Change-Id: I5164549afe6997f4512c9dc1954b97ca7a2c6c4d
This commit is contained in:
Patrick Jones
2021-01-11 11:26:11 -08:00
parent d16feb8435
commit 3bbb4361ee
2 changed files with 3 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ import (
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
"os"
)
@@ -24,7 +25,7 @@ func (cs fileCredentialSource) subjectToken() (string, error) {
return "", fmt.Errorf("oauth2/google: failed to open credential file %q", cs.File)
}
defer tokenFile.Close()
tokenBytes, err := ioutil.ReadAll(tokenFile)
tokenBytes, err := ioutil.ReadAll(io.LimitReader(tokenFile, 1<<20))
if err != nil {
return "", fmt.Errorf("oauth2/google: failed to read credential file: %v", err)
}