summaryrefslogtreecommitdiff
path: root/win32/win32.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-25 08:37:17 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-25 08:37:17 (GMT)
commitfffcf46f938932e4f48b623ab9816d5a6b9d301f (patch)
tree40740b4543a99eccb66c11972264ecb64bad769d /win32/win32.c
parent7ed3aae2feb91c584c5402dd6f63c145acd1f033 (diff)
win32.c: unknown reparse tags
* win32/win32.c (rb_w32_read_reparse_point): skip unknown reparse tags. [ruby-core:83539] [Bug #14047] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/win32.c')
-rw-r--r--win32/win32.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 8f78b54..3887193 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)