Pavel Sanda wrote:
> Vincent van Ravesteijn wrote:
> > According to the code: bytes_end = bytes_begin + info.st_size, which would 
> > mean info.st_size is 150 MB ?
> >
> > Is fstat failing in this case, or did you really have a file of 150MB ?
> 
> and in any case we do not check for return value of fstat, which looks wrong.

does this patch help?
p
diff --git a/src/support/FileName.cpp b/src/support/FileName.cpp
index 54c6fc9..7adbfa6 100644
--- a/src/support/FileName.cpp
+++ b/src/support/FileName.cpp
@@ -543,7 +543,9 @@ unsigned long FileName::checksum() const
                return result;
 
        struct stat info;
-       fstat(fd, &info);
+       if (!fstat(fd, &info))
+               return result;
+
 
        void * mm = mmap(0, info.st_size, PROT_READ,
                         MAP_PRIVATE, fd, 0);

Reply via email to