Skip to content

Commit d64cff4

Browse files
bradfitzdmitshur
authored andcommitted
[release-branch.go1.15-bundle] icmp, webdav/internal/xml: avoid string(int)
Updates golang/go#32479. For golang/go#41387. Change-Id: Ife0c3a2f10afb676af5f2110a9681216122c8808 Reviewed-on: https://go-review.googlesource.com/c/net/+/233900 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> (cherry picked from commit a91f071) Reviewed-on: https://go-review.googlesource.com/c/net/+/264217 Trust: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Alexander Rakoczy <alex@golang.org>
1 parent e0ff5e5 commit d64cff4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

icmp/interface.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ func parseInterfaceIdent(b []byte) (Extension, error) {
300300
}
301301
switch ifi.Type {
302302
case typeInterfaceByName:
303-
ifi.Name = strings.Trim(string(b[4:]), string(0))
303+
ifi.Name = strings.Trim(string(b[4:]), "\x00")
304304
case typeInterfaceByIndex:
305305
if len(b[4:]) < 4 {
306306
return nil, errInvalidExtension

webdav/internal/xml/xml.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ func (d *Decoder) ungetc(b byte) {
945945
d.offset--
946946
}
947947

948-
var entity = map[string]int{
948+
var entity = map[string]rune{
949949
"lt": '<',
950950
"gt": '>',
951951
"amp": '&',
@@ -1040,7 +1040,7 @@ Input:
10401040
d.buf.WriteByte(';')
10411041
n, err := strconv.ParseUint(s, base, 64)
10421042
if err == nil && n <= unicode.MaxRune {
1043-
text = string(n)
1043+
text = string(rune(n))
10441044
haveText = true
10451045
}
10461046
}

0 commit comments

Comments
 (0)