diff options
author | NARUSE, Yui <naruse@airemix.jp> | 2022-04-12 19:54:07 +0900 |
---|---|---|
committer | NARUSE, Yui <naruse@airemix.jp> | 2022-04-12 19:54:07 +0900 |
commit | 8d142ecff9af7d60728b8cfa9138e8623985c428 (patch) | |
tree | 56e6a4d43a18debab9ee97325684c0cfc2eee74a /missing | |
parent | 73f45e5e96ccc13a131f7c0122cf8600ce5b930f (diff) |
Fix dtoa buffer overrun
Diffstat (limited to 'missing')
-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; } } |