diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-11-17 23:41:44 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-11-17 23:41:44 +0000 |
| commit | 1d4d4dab7c6883b070208ac5de05d1a5163e5b4d (patch) | |
| tree | 300e11fda0bc457cf727dc41f00be554431fbb6b /string.c | |
| parent | fec2c47eba629132adbebbdc2343ebbff3703439 (diff) | |
| download | ruby-1d4d4dab7c6883b070208ac5de05d1a5163e5b4d.tar.gz ruby-1d4d4dab7c6883b070208ac5de05d1a5163e5b4d.tar.xz ruby-1d4d4dab7c6883b070208ac5de05d1a5163e5b4d.zip | |
* string.c (str_utf8_nth): fixed overrun. [ruby-core:26787]
?\012
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
| -rw-r--r-- | string.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -1483,6 +1483,7 @@ str_utf8_nth(const char *p, const char *e, long nth) } while (s < t && (int)sizeof(VALUE) <= nth); p = (char *)s; } + if (p > e) return 0; while (p < e) { if (is_utf8_lead_byte(*p)) { if (nth == 0) break; |
