fix examples to work with NULL buffer on getting extended attributes

This commit is contained in:
alhimik45
2020-08-29 16:29:06 +03:00
parent 91c4e1784d
commit 69e39dc188
3 changed files with 10 additions and 5 deletions

View File

@@ -337,7 +337,7 @@ namespace Mono.Fuse.NETStandard.Samples {
protected override Errno OnGetPathExtendedAttribute (string path, string name, byte[] value, out int bytesWritten)
{
int r = bytesWritten = (int) Syscall.lgetxattr (basedir+path, name, value, (ulong) value.Length);
int r = bytesWritten = (int) Syscall.lgetxattr (basedir+path, name, value, (ulong) (value?.Length ?? 0));
if (r == -1)
return Stdlib.GetLastError ();
return 0;