summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
Diffstat (limited to 'strings')
-rw-r--r--strings/ctype-simple.c5
-rw-r--r--strings/ctype-uca.c7
-rw-r--r--strings/json_lib.c1
3 files changed, 9 insertions, 4 deletions
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index 1ce180e30e4..9c6cb34137d 100644
--- a/strings/ctype-simple.c
+++ b/strings/ctype-simple.c
@@ -1795,9 +1795,10 @@ ret_sign:
{
if (negative)
{
- if (ull > (ulonglong) LONGLONG_MIN)
+ if (ull >= (ulonglong) LONGLONG_MIN)
{
- *error= MY_ERRNO_ERANGE;
+ if (ull != (ulonglong) LONGLONG_MIN)
+ *error= MY_ERRNO_ERANGE;
return (ulonglong) LONGLONG_MIN;
}
*error= 0;
diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c
index 312b903ea64..a519287c0e4 100644
--- a/strings/ctype-uca.c
+++ b/strings/ctype-uca.c
@@ -31467,9 +31467,11 @@ static inline uint16 *
my_uca_contraction_weight(const MY_CONTRACTIONS *list, my_wc_t *wc, size_t len)
{
MY_CONTRACTION *c, *last;
+ DBUG_ASSERT(len <= MY_UCA_MAX_CONTRACTION);
+
for (c= list->item, last= c + list->nitems; c < last; c++)
{
- if ((len == MY_UCA_MAX_CONTRACTION || c->ch[len] == 0) &&
+ if ((len >= MY_UCA_MAX_CONTRACTION || c->ch[len] == 0) &&
!c->with_context &&
!my_wmemcmp(c->ch, wc, len))
return c->weight;
@@ -33212,7 +33214,8 @@ my_char_weight_put(MY_UCA_WEIGHT_LEVEL *dst,
for (chlen= len; chlen > 1; chlen--)
{
- if ((from= my_uca_contraction_weight(&dst->contractions, str, chlen)))
+ if (chlen <= MY_UCA_MAX_CONTRACTION &&
+ (from= my_uca_contraction_weight(&dst->contractions, str, chlen)))
{
str+= chlen;
len-= chlen;
diff --git a/strings/json_lib.c b/strings/json_lib.c
index 83d5fdaa016..7265afdf355 100644
--- a/strings/json_lib.c
+++ b/strings/json_lib.c
@@ -933,6 +933,7 @@ int json_read_value(json_engine_t *j)
{
int t_next, c_len, res;
+ j->value_type= JSON_VALUE_UNINITALIZED;
if (j->state == JST_KEY)
{
while (json_read_keyname_chr(j) == 0) {}