summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--util.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 5d44a9d305..1a9b1a443b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Thu Jan 29 23:56:00 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+
+ * util.c (mblen): fix overrun. [ruby-dev:22672]
+
Thu Jan 29 15:33:23 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_x509hame.c (ossl_x509name_initialize): change
diff --git a/util.c b/util.c
index cb0b4912f4..437632861e 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