From 053d54bc59144169a0ecf26e694415af4991bada Mon Sep 17 00:00:00 2001 From: obdev Date: Wed, 21 Sep 2022 13:02:36 +0000 Subject: [PATCH] [CP] Fix string to number access out of bound core --- deps/oblib/src/lib/number/ob_number_v2.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/deps/oblib/src/lib/number/ob_number_v2.cpp b/deps/oblib/src/lib/number/ob_number_v2.cpp index 7f542c533..3efaabaa8 100644 --- a/deps/oblib/src/lib/number/ob_number_v2.cpp +++ b/deps/oblib/src/lib/number/ob_number_v2.cpp @@ -373,9 +373,8 @@ int ObNumber::from_sci_(const char* str, const int64_t length, IAllocator& alloc } } if (cur <= '9' && cur >= '0') { - cur = str[++i]; - while (i < length && cur <= '9' && cur >= '0') { - cur = str[++i]; + while (cur <= '9' && cur >= '0' && (++i < length)) { + cur = str[i]; } } else { /* 0e */ -- GitLab