summaryrefslogtreecommitdiff
path: root/vendor/golang.org/x/sys/unix/xattr_bsd.go
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2023-02-18 16:52:33 +0100
committerLibravatar GitHub <noreply@github.com>2023-02-18 16:52:33 +0100
commit3649b231c4960cd02b6741039ba022c2e413a814 (patch)
tree698bd76ce8436fb3cb06a5ec3781d0d72f4889b9 /vendor/golang.org/x/sys/unix/xattr_bsd.go
parent[bugfix] Keep png transparency (#1522) (diff)
downloadgotosocial-3649b231c4960cd02b6741039ba022c2e413a814.tar.xz
[chore]: Bump golang.org/x/net from 0.5.0 to 0.7.0 (#1523)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.5.0 to 0.7.0. - [Release notes](https://github.com/golang/net/releases) - [Commits](https://github.com/golang/net/compare/v0.5.0...v0.7.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>
Diffstat (limited to 'vendor/golang.org/x/sys/unix/xattr_bsd.go')
-rw-r--r--vendor/golang.org/x/sys/unix/xattr_bsd.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/vendor/golang.org/x/sys/unix/xattr_bsd.go b/vendor/golang.org/x/sys/unix/xattr_bsd.go
index 663b3779d..f5f8e9f36 100644
--- a/vendor/golang.org/x/sys/unix/xattr_bsd.go
+++ b/vendor/golang.org/x/sys/unix/xattr_bsd.go
@@ -36,9 +36,14 @@ func xattrnamespace(fullattr string) (ns int, attr string, err error) {
func initxattrdest(dest []byte, idx int) (d unsafe.Pointer) {
if len(dest) > idx {
return unsafe.Pointer(&dest[idx])
- } else {
- return unsafe.Pointer(_zero)
}
+ if dest != nil {
+ // extattr_get_file and extattr_list_file treat NULL differently from
+ // a non-NULL pointer of length zero. Preserve the property of nilness,
+ // even if we can't use dest directly.
+ return unsafe.Pointer(&_zero)
+ }
+ return nil
}
// FreeBSD and NetBSD implement their own syscalls to handle extended attributes