From d103ed6ca97ca5a2669f6cf5fe4b3d2a9c945f26 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Wed, 17 May 2017 16:51:25 -0400 Subject: Upgrading server dependancies (#6431) --- vendor/golang.org/x/text/unicode/norm/input.go | 8 ++++++-- .../golang.org/x/text/unicode/norm/normalize_test.go | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) (limited to 'vendor/golang.org/x/text/unicode') diff --git a/vendor/golang.org/x/text/unicode/norm/input.go b/vendor/golang.org/x/text/unicode/norm/input.go index 045d4ccce..479e35bc2 100644 --- a/vendor/golang.org/x/text/unicode/norm/input.go +++ b/vendor/golang.org/x/text/unicode/norm/input.go @@ -90,16 +90,20 @@ func (in *input) charinfoNFKC(p int) (uint16, int) { } func (in *input) hangul(p int) (r rune) { + var size int if in.bytes == nil { if !isHangulString(in.str[p:]) { return 0 } - r, _ = utf8.DecodeRuneInString(in.str[p:]) + r, size = utf8.DecodeRuneInString(in.str[p:]) } else { if !isHangul(in.bytes[p:]) { return 0 } - r, _ = utf8.DecodeRune(in.bytes[p:]) + r, size = utf8.DecodeRune(in.bytes[p:]) + } + if size != hangulUTF8Size { + return 0 } return r } diff --git a/vendor/golang.org/x/text/unicode/norm/normalize_test.go b/vendor/golang.org/x/text/unicode/norm/normalize_test.go index 69a84bfaa..4f837372c 100644 --- a/vendor/golang.org/x/text/unicode/norm/normalize_test.go +++ b/vendor/golang.org/x/text/unicode/norm/normalize_test.go @@ -699,6 +699,24 @@ var appendTestsNFC = []AppendTest{ "\u0d4a" + strings.Repeat("\u0d3e", 30), "\u0d4a" + strings.Repeat("\u0d3e", 29) + cgj + "\u0d3e", }, + + { // https://golang.org/issues/20079 + "", + "\xeb\u0344", + "\xeb\u0308\u0301", + }, + + { // https://golang.org/issues/20079 + "", + "\uac00" + strings.Repeat("\u0300", 30), + "\uac00" + strings.Repeat("\u0300", 29) + "\u034f\u0300", + }, + + { // https://golang.org/issues/20079 + "", + "\xeb" + strings.Repeat("\u0300", 31), + "\xeb" + strings.Repeat("\u0300", 30) + "\u034f\u0300", + }, } var appendTestsNFD = []AppendTest{ -- cgit v1.2.3-1-g7c22