aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-07 06:02:21 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-07 06:02:21 +0000
commit8a0ab36db160331190299a5b6e5483b8b47e98e2 (patch)
treed0de197b515204411fddf8a23333ac92c9410d70 /file.c
parent548497d545b72aa3a73ee7514cc4aacbe1c7536e (diff)
downloadruby-8a0ab36db160331190299a5b6e5483b8b47e98e2.tar.gz
file.c: skip invalid byte
* file.c (rb_str_normalize_ospath): skip invalid byte sequence not to loop infinitely. this case usually does not happen as the input name should come from real file systems. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/file.c b/file.c
index 96b89e55c1..1adbe76802 100644
--- a/file.c
+++ b/file.c
@@ -294,6 +294,8 @@ rb_str_normalize_ospath(const char *ptr, long len)
rb_str_append(str, rb_str_normalize_ospath0(p1, p-p1));
rb_str_cat2(str, "\xEF\xBF\xBD");
p += 1;
+ p1 = p;
+ continue;
}
l = MBCLEN_CHARFOUND_LEN(r);
c = rb_enc_mbc_to_codepoint(p, e, enc);