summaryrefslogtreecommitdiffhomepage
path: root/src/string.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2020-01-07 08:58:06 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2020-01-07 08:58:06 +0900
commitafad9391734998df4f76a6f7108278d2aa2599a0 (patch)
tree7cb83491497f952e5e8e050112f2d23b4c7abecf /src/string.c
parent3e4e10ffb6576aacf66b6648242e0454ca85c2fd (diff)
downloadmruby-afad9391734998df4f76a6f7108278d2aa2599a0.tar.gz
mruby-afad9391734998df4f76a6f7108278d2aa2599a0.zip
Check memory boundary in `mrb_str_len_to_dbl`.
Diffstat (limited to 'src/string.c')
-rw-r--r--src/string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/string.c b/src/string.c
index bf11ed668..e61a85cff 100644
--- a/src/string.c
+++ b/src/string.c
@@ -2500,7 +2500,7 @@ mrb_str_len_to_dbl(mrb_state *mrb, const char *s, size_t len, mrb_bool badcheck)
double d;
if (!p) return 0.0;
- while (ISSPACE(*p)) p++;
+ while (p<pend && ISSPACE(*p)) p++;
if (pend - p > 2 && p[0] == '0' && (p[1] == 'x' || p[1] == 'X')) {
mrb_value x;