mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
MDEV-7086 main.ctype_cp932 fails in buildbot on a valgrind build
Removing a redundant and wrong condition which could access beyond the pattern string range.
This commit is contained in:
parent
4d882329a9
commit
807934d083
3 changed files with 16 additions and 5 deletions
|
@ -395,7 +395,7 @@ int my_wildcmp_bin_impl(CHARSET_INFO *cs,
|
|||
if (tmp <= 0)
|
||||
return(tmp);
|
||||
}
|
||||
} while (str != str_end && wildstr[0] != w_many);
|
||||
} while (str != str_end);
|
||||
return(-1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -354,7 +354,7 @@ int my_wildcmp_mb_impl(CHARSET_INFO *cs,
|
|||
if (tmp <= 0)
|
||||
return (tmp);
|
||||
}
|
||||
} while (str != str_end && wildstr[0] != w_many);
|
||||
} while (str != str_end);
|
||||
return(-1);
|
||||
}
|
||||
}
|
||||
|
@ -1192,7 +1192,7 @@ static int my_wildcmp_mb_bin_impl(CHARSET_INFO *cs,
|
|||
if (tmp <= 0)
|
||||
return (tmp);
|
||||
}
|
||||
} while (str != str_end && wildstr[0] != w_many);
|
||||
} while (str != str_end);
|
||||
return(-1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -936,9 +936,14 @@ int my_wildcmp_8bit_impl(CHARSET_INFO *cs,
|
|||
cmp=likeconv(cs,cmp);
|
||||
do
|
||||
{
|
||||
/*
|
||||
Find the next character in the subject string equal to 'cmp', then
|
||||
check recursively my_wildcmp_8bit_impl() for the pattern remainder.
|
||||
*/
|
||||
while (str != str_end && (uchar) likeconv(cs,*str) != cmp)
|
||||
str++;
|
||||
if (str++ == str_end) return(-1);
|
||||
if (str++ == str_end)
|
||||
return(-1); /* 'cmp' was not found in the subject string */
|
||||
{
|
||||
int tmp=my_wildcmp_8bit_impl(cs,str,str_end,
|
||||
wildstr,wildend,escape,w_one,
|
||||
|
@ -946,7 +951,13 @@ int my_wildcmp_8bit_impl(CHARSET_INFO *cs,
|
|||
if (tmp <= 0)
|
||||
return(tmp);
|
||||
}
|
||||
} while (str != str_end && wildstr[0] != w_many);
|
||||
/*
|
||||
The recursion call did not match. But it returned 1, which means
|
||||
the pattern remainder has some non-special characters.
|
||||
Continue, there is a chance that we'll find another 'cmp'
|
||||
at a different position in the subject string.
|
||||
*/
|
||||
} while (str != str_end);
|
||||
return(-1);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue