EtiennePerot / fuse-jna

No-nonsense, actually-working Java bindings to FUSE using JNA.
http://fusejna.net/
Other
137 stars 43 forks source link

java.lang.NullPointerException at net.fusejna.FuseFilesystem._listxattr(FuseFilesystem.java:167) #3

Closed onokonem closed 11 years ago

onokonem commented 11 years ago

Simple patch

diff --git a/src/net/fusejna/FuseFilesystem.java b/src/net/fusejna/FuseFilesystem.java
index 88fe54b..09e9313 100644
--- a/src/net/fusejna/FuseFilesystem.java
+++ b/src/net/fusejna/FuseFilesystem.java
@@ -163,6 +163,8 @@ public abstract class FuseFilesystem
    @FuseMethod
    final int _listxattr(final String path, final Pointer buffer, final TypeSize size)
    {
+       if (buffer == null)
+         { return 0; };
        final long sizeValue = size.longValue();
        final XattrListFiller filler = new XattrListFiller(buffer.getByteBuffer(0, sizeValue), sizeValue);
        return listxattr(path, filler);
onokonem commented 11 years ago

actually, I guess I have to submit it trough pull request