summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/path.c2
-rw-r--r--src/win32/filesystem_win32.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/path.c b/src/path.c
index 8d68781..7e67af6 100644
--- a/src/path.c
+++ b/src/path.c
@@ -697,7 +697,7 @@ zix_path_is_absolute(const char* const path)
{
#ifdef _WIN32
const ZixRootSlices root = zix_path_root_slices(path);
- return (!zix_is_empty_range(root.name) &&
+ return (path && !zix_is_empty_range(root.name) &&
(!zix_is_empty_range(root.dir) ||
(is_dir_sep(path[0]) && is_dir_sep(path[1]))));
diff --git a/src/win32/filesystem_win32.c b/src/win32/filesystem_win32.c
index 21bb94e..24ba427 100644
--- a/src/win32/filesystem_win32.c
+++ b/src/win32/filesystem_win32.c
@@ -365,7 +365,9 @@ zix_file_type(const char* const path)
// Resolve symlink to find the canonical type
char* const canonical = zix_canonical_path(NULL, path);
- const ZixFileType real_type = zix_symlink_type(canonical);
+ const ZixFileType real_type =
+ canonical ? zix_symlink_type(canonical) : ZIX_FILE_TYPE_NONE;
+
zix_free(NULL, canonical);
return real_type;
}