diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-25 08:37:17 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-25 08:37:17 +0000 |
commit | 6360bf6033ad93d5bc124750c8e15a5df96ca646 (patch) | |
tree | 40740b4543a99eccb66c11972264ecb64bad769d /win32 | |
parent | 46ec9788ce74ec768743c94b38f6ff69e4b1488b (diff) | |
download | ruby-6360bf6033ad93d5bc124750c8e15a5df96ca646.tar.gz |
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')
-rw-r--r-- | win32/win32.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/win32/win32.c b/win32/win32.c index 8f78b541dd..3887193116 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) |