diff options
author | nagachika <nagachika@ruby-lang.org> | 2022-04-12 20:08:08 +0900 |
---|---|---|
committer | nagachika <nagachika@ruby-lang.org> | 2022-04-12 20:48:55 +0900 |
commit | 3fa771ddedac25560be57f4055f1767e6c810f58 (patch) | |
tree | 5c2d9df8a1a2fdb3ff38f878308757d96cd88746 /missing/dtoa.c | |
parent | 052ec6d2585c3ace95671013d336f5543624ef3d (diff) |
Fix dtoa buffer overrunv3_0_4
Diffstat (limited to 'missing/dtoa.c')
-rw-r--r-- | missing/dtoa.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/missing/dtoa.c b/missing/dtoa.c index a940eabd91..b7a8302875 100644 --- a/missing/dtoa.c +++ b/missing/dtoa.c @@ -1552,6 +1552,7 @@ break2: if (!*++s || !(s1 = strchr(hexdigit, *s))) goto ret0; if (*s == '0') { while (*++s == '0'); + if (!*s) goto ret; s1 = strchr(hexdigit, *s); } if (s1 != NULL) { @@ -1574,7 +1575,7 @@ break2: for (; *s && (s1 = strchr(hexdigit, *s)); ++s) { adj += aadj * ((s1 - hexdigit) & 15); if ((aadj /= 16) == 0.0) { - while (strchr(hexdigit, *++s)); + while (*++s && strchr(hexdigit, *s)); break; } } |