From dfd322b36cd023ab603efd0652aa84c3fc98a43e Mon Sep 17 00:00:00 2001 From: eban Date: Mon, 25 Oct 2004 09:40:55 +0000 Subject: * win32/win32.c (isUNCRoot): should check NUL after '.'. [ruby-dev:24590] * win32/win32.c (isUNCRoot): fixed buffer overrun. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- win32/win32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'win32') diff --git a/win32/win32.c b/win32/win32.c index 86a791da08..2bd7682a79 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -2701,7 +2701,7 @@ isUNCRoot(const char *path) { if (path[0] == '\\' && path[1] == '\\') { const char *p; - for (p = path + 3; *p; p = CharNext(p)) { + for (p = path + 2; *p; p = CharNext(p)) { if (*p == '\\') break; } @@ -2710,7 +2710,7 @@ isUNCRoot(const char *path) if (*p == '\\') break; } - if (!p[0] || !p[1] || (p[0] == '\\' && p[1] == '.')) + if (!p[0] || !p[1] || (p[1] == '.' && !p[2])) return 1; } } -- cgit v1.2.3