This commit is contained in:
Emil 2023-10-07 18:14:49 +00:00
parent 0d7605a43f
commit 981a1931d4
No known key found for this signature in database
GPG Key ID: 5432DB986FDBCF8A

View File

@ -57,8 +57,9 @@ find_region(const char * fn)
fd = open(fn, O_RDONLY); fd = open(fn, O_RDONLY);
if ( fd != -1 if (fd != -1)
&& !fstat(fd,&s) {
if (!fstat(fd,&s)
&& s.st_mode & S_IFREG && s.st_mode & S_IFREG
&& s.st_size) && s.st_size)
{ {
@ -100,6 +101,8 @@ find_region(const char * fn)
munmap(addr, s.st_size); munmap(addr, s.st_size);
} }
} }
close(fd);
}
return buf; return buf;
} }