mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-01 14:47:28 -04:00
unix: stop counting trailing NUL for abstract addresses starting with NUL
Changes trailing-NUL-counting behavior for abstract addresses starting with the NUL character to be the same as abstract addresses starting with the @ character. For golang/go#63579. Change-Id: I2f26de4bcf614c4635ad188b1afa3d14ebd9a95f Reviewed-on: https://go-review.googlesource.com/c/sys/+/535955 Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Benny Siegert <bsiegert@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
@@ -517,7 +517,7 @@ func TestSockaddrUnix_sockaddr(t *testing.T) {
|
||||
slen: 2, // family (uint16)
|
||||
},
|
||||
{
|
||||
name: "abstract",
|
||||
name: "abstract_starting_with_at",
|
||||
sa: &SockaddrUnix{
|
||||
Name: "@",
|
||||
},
|
||||
@@ -526,6 +526,16 @@ func TestSockaddrUnix_sockaddr(t *testing.T) {
|
||||
},
|
||||
slen: 3, // family (uint16) + NULL
|
||||
},
|
||||
{
|
||||
name: "abstract_starting_with_null",
|
||||
sa: &SockaddrUnix{
|
||||
Name: "\x00",
|
||||
},
|
||||
raw: &RawSockaddrUnix{
|
||||
Family: AF_UNIX,
|
||||
},
|
||||
slen: 3, // family (uint16) + NULL
|
||||
},
|
||||
{
|
||||
name: "named",
|
||||
sa: &SockaddrUnix{
|
||||
|
||||
Reference in New Issue
Block a user