Index: src/OFFileIRIHandler.m ================================================================== --- src/OFFileIRIHandler.m +++ src/OFFileIRIHandler.m @@ -1598,13 +1598,19 @@ # if defined(OF_LINUX) ssize_t size = lgetxattr(cPath, cName, NULL, 0); # elif defined(OF_MACOS) ssize_t size = getxattr(cPath, cName, NULL, 0, 0, XATTR_NOFOLLOW); # endif - void *value = OFAllocMemory(1, size); + void *value; OFData *data; + if (size < 0) + @throw [OFGetItemAttributesFailedException + exceptionWithIRI: IRI + errNo: errno]; + + value = OFAllocMemory(1, size); @try { # if defined(OF_LINUX) if ((size = lgetxattr(cPath, cName, value, size)) < 0) # elif defined(OF_MACOS) if ((size = getxattr(cPath, cName, value, size, 0,