[Forensics-changes] [yara] 51/135: Fix bug in Window's version of is_directory function
Hilko Bengen
bengen at moszumanska.debian.org
Sat Jul 1 10:27:31 UTC 2017
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to annotated tag v3.1.0
in repository yara.
commit b056a7d3d4da4913af978f9f7e9b8014b89cfcfb
Author: Victor M. Alvarez <plusvic at gmail.com>
Date: Mon Jul 7 14:06:58 2014 +0200
Fix bug in Window's version of is_directory function
---
yara.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/yara.c b/yara.c
index 4db951a..f40a42e 100644
--- a/yara.c
+++ b/yara.c
@@ -249,7 +249,10 @@ char* file_queue_get()
int is_directory(
const char* path)
{
- if (GetFileAttributes(path) & FILE_ATTRIBUTE_DIRECTORY)
+ DWORD attributes = GetFileAttributes(path);
+
+ if (attributes != INVALID_FILE_ATTRIBUTES &&
+ attributes & FILE_ATTRIBUTE_DIRECTORY)
return TRUE;
else
return FALSE;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/forensics/yara.git
More information about the forensics-changes
mailing list