summaryrefslogtreecommitdiff
path: root/vendor/golang.org/x/text/language
diff options
context:
space:
mode:
authordependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2021-11-22 17:01:27 +0000
committerGitHub <noreply@github.com>2021-11-22 17:01:27 +0000
commit73e95d1c3eea36ec5e294115a7aa4c9fd16445fd (patch)
treeeef0df38160cea16c30fa2ed66caeffcb3467442 /vendor/golang.org/x/text/language
parentbfc929efc44cc9255406ed6c2abec1b8a4f36dab (diff)
downloadpodman-73e95d1c3eea36ec5e294115a7aa4c9fd16445fd.tar.gz
podman-73e95d1c3eea36ec5e294115a7aa4c9fd16445fd.tar.bz2
podman-73e95d1c3eea36ec5e294115a7aa4c9fd16445fd.zip
Bump github.com/containers/image/v5 from 5.16.1 to 5.17.0
Bumps [github.com/containers/image/v5](https://github.com/containers/image) from 5.16.1 to 5.17.0. - [Release notes](https://github.com/containers/image/releases) - [Commits](https://github.com/containers/image/compare/v5.16.1...v5.17.0) --- updated-dependencies: - dependency-name: github.com/containers/image/v5 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Diffstat (limited to 'vendor/golang.org/x/text/language')
-rw-r--r--vendor/golang.org/x/text/language/parse.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/vendor/golang.org/x/text/language/parse.go b/vendor/golang.org/x/text/language/parse.go
index 11acfd885..59b041008 100644
--- a/vendor/golang.org/x/text/language/parse.go
+++ b/vendor/golang.org/x/text/language/parse.go
@@ -43,6 +43,13 @@ func Parse(s string) (t Tag, err error) {
// https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers.
// The resulting tag is canonicalized using the canonicalization type c.
func (c CanonType) Parse(s string) (t Tag, err error) {
+ defer func() {
+ if recover() != nil {
+ t = Tag{}
+ err = language.ErrSyntax
+ }
+ }()
+
tt, err := language.Parse(s)
if err != nil {
return makeTag(tt), err
@@ -79,6 +86,13 @@ func Compose(part ...interface{}) (t Tag, err error) {
// tag is returned after canonicalizing using CanonType c. If one or more errors
// are encountered, one of the errors is returned.
func (c CanonType) Compose(part ...interface{}) (t Tag, err error) {
+ defer func() {
+ if recover() != nil {
+ t = Tag{}
+ err = language.ErrSyntax
+ }
+ }()
+
var b language.Builder
if err = update(&b, part...); err != nil {
return und, err
@@ -142,6 +156,14 @@ var errInvalidWeight = errors.New("ParseAcceptLanguage: invalid weight")
// Tags with a weight of zero will be dropped. An error will be returned if the
// input could not be parsed.
func ParseAcceptLanguage(s string) (tag []Tag, q []float32, err error) {
+ defer func() {
+ if recover() != nil {
+ tag = nil
+ q = nil
+ err = language.ErrSyntax
+ }
+ }()
+
var entry string
for s != "" {
if entry, s = split(s, ','); entry == "" {