Mercurial > hg > truffle
diff src/share/vm/compiler/compilerOracle.cpp @ 18688:0eba324e27db
strcpy doesn't handle overlapping strings
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Mon, 15 Dec 2014 12:56:22 -0800 |
parents | 52b4284cb496 |
children | 5281f8e34a4a |
line wrap: on
line diff
--- a/src/share/vm/compiler/compilerOracle.cpp Mon Dec 15 12:25:36 2014 -0800 +++ b/src/share/vm/compiler/compilerOracle.cpp Mon Dec 15 12:56:22 2014 -0800 @@ -397,7 +397,8 @@ int match = MethodMatcher::Exact; while (name[0] == '*') { match |= MethodMatcher::Suffix; - strcpy(name, name + 1); + // Copy remaining string plus NUL to the beginning + memcpy(name, name + 1, strlen(name + 1) + 1); } if (strcmp(name, "*") == 0) return MethodMatcher::Any;