From 6a0a4ed6b86f8cbea8ee0e67db62f2deca6b8b45 Mon Sep 17 00:00:00 2001 From: Alexander Peresypkin <7003484@gmail.com> Date: Sun, 21 Jul 2019 17:31:23 +0200 Subject: [PATCH] Fix parsing text values in binary operands Bug https://bugs.mysql.com/bug.php?id=95960 --- strings/my_strtoll10.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/strings/my_strtoll10.cc b/strings/my_strtoll10.cc index 32eddd2f4fa..9d6ca5cebd0 100644 --- a/strings/my_strtoll10.cc +++ b/strings/my_strtoll10.cc @@ -31,6 +31,7 @@ #include "m_string.h" // IWYU pragma: keep #include "my_inttypes.h" #include "my_sys.h" /* Needed for MY_ERRNO_ERANGE */ +#include #define MAX_NEGATIVE_NUMBER ((ulonglong)0x8000000000000000LL) #define INIT_CNT 9 @@ -96,11 +97,11 @@ longlong my_strtoll10(const char *nptr, const char **endptr, int *error) { /* If fixed length string */ if (endptr) { end = *endptr; - while (s != end && (*s == ' ' || *s == '\t')) s++; + while (s != end && isspace(*s)) s++; if (s == end) goto no_conv; } else { endptr = &dummy; /* Easier end test */ - while (*s == ' ' || *s == '\t') s++; + while (isspace(*s)) s++; if (!*s) goto no_conv; /* This number must be big to guard against a lot of pre-zeros */ end = s + 65535; /* Can't be longer than this */