aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-01-29 14:56:26 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-01-29 14:56:26 +0000
commitb685848c6658ffeb98d67498c984f5d38c5c6394 (patch)
tree3fbf06d97e1591acd5dfd8e1b646662ac9db010e
parent181a3a2af5df88d145b73a060d51fe437c8c4ad4 (diff)
downloadruby-b685848c6658ffeb98d67498c984f5d38c5c6394.tar.gz
* util.c (mblen): fix overrun. [ruby-dev:22672]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog2
-rw-r--r--util.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 2cf512df72..c1c4c7e8ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,8 @@ Thu Jan 29 23:11:57 2004 WATANABE Hirofumi <eban@ruby-lang.org>
* bcc32/Makefile.sub, win32/Makefile.sub, wince/Makefile.sub (DLEXT2):
ditto.
+ * util.c (mblen): fix overrun. [ruby-dev:22672]
+
Thu Jan 29 22:41:53 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/generators/html_generator.rb: Allow 'link:' in Tidylinks.
diff --git a/util.c b/util.c
index a1e2dd34a7..13c4f87d09 100644
--- a/util.c
+++ b/util.c
@@ -296,6 +296,8 @@ mblen(const char *s, size_t n)
if (s) {
if (n == 0 || *s == 0)
return 0;
+ else if (!s[1])
+ return 1;
return dbcs_table[(unsigned char)*s] + 1;
}
else