diff options
author | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-10-25 09:40:55 +0000 |
---|---|---|
committer | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-10-25 09:40:55 +0000 |
commit | c62c36ed12b2793ea4e551976bbf24a2d3b071b5 (patch) | |
tree | 0cdd0f4b7378dc26c63248c34e4a6d276afb0b00 /win32/win32.c | |
parent | 7e32376949129418d97532f1d20271f4e33005d6 (diff) | |
download | ruby-c62c36ed12b2793ea4e551976bbf24a2d3b071b5.tar.gz ruby-c62c36ed12b2793ea4e551976bbf24a2d3b071b5.tar.xz ruby-c62c36ed12b2793ea4e551976bbf24a2d3b071b5.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/trunk@7112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/win32.c')
-rw-r--r-- | win32/win32.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/win32/win32.c b/win32/win32.c index 1363d7871..b2f4695a9 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -2811,7 +2811,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; } @@ -2820,7 +2820,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; } } |