diff --git a/util/script.c b/util/script.c index 468d4d8..339980d 100644 --- a/util/script.c +++ b/util/script.c @@ -7882,6 +7882,9 @@ void *LibraryGetAddress(void *library, const char *name) { void *FileLoad(const char *path, size_t *length) { FILE *file = fopen(path, "rb"); if (!file) return NULL; + struct stat s; + fstat(fileno(file), &s); + if (!S_ISREG(s.st_mode)) { fclose(file); errno = EISDIR; return NULL; } fseek(file, 0, SEEK_END); size_t fileSize = ftell(file); fseek(file, 0, SEEK_SET);