summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--win32/win32.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 8f78b541dd8..38871931160 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -5017,7 +5017,7 @@ rb_w32_read_reparse_point(const WCHAR *path, rb_w32_reparse_buffer_t *rp,
ret = rp->SymbolicLinkReparseBuffer.PrintNameLength;
*len = ret / sizeof(WCHAR);
}
- else { /* IO_REPARSE_TAG_MOUNT_POINT */
+ else if (rp->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT) {
static const WCHAR *volume = L"Volume{";
enum {volume_prefix_len = rb_strlen_lit("\\??\\")};
name = ((char *)rp->MountPointReparseBuffer.PathBuffer +
@@ -5030,6 +5030,9 @@ rb_w32_read_reparse_point(const WCHAR *path, rb_w32_reparse_buffer_t *rp,
memcmp(name, volume, sizeof(volume) - 1 * sizeof(WCHAR)) == 0)
return -1;
}
+ else {
+ return -1;
+ }
*result = name;
if (e) {
if ((char *)name + ret + sizeof(WCHAR) > (char *)rp + bufsize)