Skip to content

Commit

Permalink
syscall: stop counting trailing NUL for abstract addresses starting w…
Browse files Browse the repository at this point in the history
…ith NUL
  • Loading branch information
1f604 committed Oct 16, 2023
1 parent 5873bd1 commit 156894c
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/cmd/vendor/golang.org/x/sys/unix/syscall_aix.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/cmd/vendor/golang.org/x/sys/unix/syscall_linux.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/cmd/vendor/golang.org/x/sys/unix/syscall_solaris.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/cmd/vendor/golang.org/x/sys/windows/syscall_windows.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/syscall/syscall_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) {
if n > 0 {
sl += _Socklen(n) + 1
}
if sa.raw.Path[0] == '@' {
if sa.raw.Path[0] == '@' || sa.raw.Path[0] == 0 {
sa.raw.Path[0] = 0
// Don't count trailing NUL for abstract address.
sl--
Expand Down
2 changes: 1 addition & 1 deletion src/syscall/syscall_solaris.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) {
if n > 0 {
sl += _Socklen(n) + 1
}
if sa.raw.Path[0] == '@' {
if sa.raw.Path[0] == '@' || sa.raw.Path[0] == 0 {
sa.raw.Path[0] = 0
// Don't count trailing NUL for abstract address.
sl--
Expand Down
2 changes: 1 addition & 1 deletion src/syscall/syscall_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, int32, error) {
if n > 0 {
sl += int32(n) + 1
}
if sa.raw.Path[0] == '@' {
if sa.raw.Path[0] == '@' || sa.raw.Path[0] == 0 {
sa.raw.Path[0] = 0
// Don't count trailing NUL for abstract address.
sl--
Expand Down

0 comments on commit 156894c

Please sign in to comment.