diff options
-rw-r--r-- | common/md5.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/common/md5.cpp b/common/md5.cpp index 11bc5d6487..287e14107a 100644 --- a/common/md5.cpp +++ b/common/md5.cpp @@ -234,8 +234,13 @@ void md5_finish(md5_context *ctx, uint8 digest[16]) { } bool md5_file(const FilesystemNode &file, uint8 digest[16], uint32 length) { - if (file.isDirectory()) + if (!file.isValid()) { + warning("md5_file: using an invalid FilesystemNode"); return false; + } else if (file.isDirectory()) { + warning("md5_file: using a diretory FilesystemNode"); + return false; + } return md5_file(file.path().c_str(), digest, length); } |