From 8d142ecff9af7d60728b8cfa9138e8623985c428 Mon Sep 17 00:00:00 2001 From: "NARUSE, Yui" Date: Tue, 12 Apr 2022 19:54:07 +0900 Subject: Fix dtoa buffer overrun --- missing/dtoa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'missing') 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; } } -- cgit v1.2.3