summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-25 09:40:55 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-25 09:40:55 +0000
commitf2bd0cac3cf2732a0f711b082c3565e36a34ced1 (patch)
tree0030a394d4c6ba0bfd74d57e3a6aec06006e7f54
parent320ae3b368fd8dffc0e87a0bcfcc99e9f54852af (diff)
downloadruby-f2bd0cac3cf2732a0f711b082c3565e36a34ced1.tar.gz
ruby-f2bd0cac3cf2732a0f711b082c3565e36a34ced1.tar.xz
ruby-f2bd0cac3cf2732a0f711b082c3565e36a34ced1.zip
* win32/win32.c (isUNCRoot): should check NUL after '.'.
[ruby-dev:24590] * win32/win32.c (isUNCRoot): fixed buffer overrun. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--win32/win32.c4
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 17096953c..b758e9fa5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Mon Oct 25 18:35:39 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+
+ * win32/win32.c (isUNCRoot): should check NUL after '.'.
+ [ruby-dev:24590]
+
+ * win32/win32.c (isUNCRoot): fixed buffer overrun.
+
Mon Oct 25 08:03:26 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (get_backtrace): ignore illegal backtrace. [ruby-dev:24587]
diff --git a/win32/win32.c b/win32/win32.c
index 86a791da0..2bd7682a7 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;
}
}