diff options
| author | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-01-29 14:56:26 +0000 |
|---|---|---|
| committer | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-01-29 14:56:26 +0000 |
| commit | cd04115e0621d522c04f2eef5329060bdd15c228 (patch) | |
| tree | 3fbf06d97e1591acd5dfd8e1b646662ac9db010e | |
| parent | 4e8dbbb56dedecd53ec8705967a9590afb07e576 (diff) | |
| download | ruby-cd04115e0621d522c04f2eef5329060bdd15c228.tar.gz ruby-cd04115e0621d522c04f2eef5329060bdd15c228.tar.xz ruby-cd04115e0621d522c04f2eef5329060bdd15c228.zip | |
* util.c (mblen): fix overrun. [ruby-dev:22672]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 2 | ||||
| -rw-r--r-- | util.c | 2 |
2 files changed, 4 insertions, 0 deletions
@@ -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. @@ -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 |
