8069389: CompilerOracle prefix wildcarding is broken for long strings

Replace strcpy with memmove

Reviewed-by: kvn
This commit is contained in:
Nils Eliasson 2015-01-22 11:05:14 +01:00
parent 21e2e5ffc0
commit 01ec695002
2 changed files with 80 additions and 1 deletions

View file

@ -553,7 +553,8 @@ static MethodMatcher::Mode check_mode(char name[], const char*& error_msg) {
int match = MethodMatcher::Exact;
while (name[0] == '*') {
match |= MethodMatcher::Suffix;
strcpy(name, name + 1);
// Copy remaining string plus NUL to the beginning
memmove(name, name + 1, strlen(name + 1) + 1);
}
if (strcmp(name, "*") == 0) return MethodMatcher::Any;