Mercurial > hg > truffle
comparison 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 |
comparison
equal
deleted
inserted
replaced
18687:2885aafd812f | 18688:0eba324e27db |
---|---|
395 | 395 |
396 static MethodMatcher::Mode check_mode(char name[], const char*& error_msg) { | 396 static MethodMatcher::Mode check_mode(char name[], const char*& error_msg) { |
397 int match = MethodMatcher::Exact; | 397 int match = MethodMatcher::Exact; |
398 while (name[0] == '*') { | 398 while (name[0] == '*') { |
399 match |= MethodMatcher::Suffix; | 399 match |= MethodMatcher::Suffix; |
400 strcpy(name, name + 1); | 400 // Copy remaining string plus NUL to the beginning |
401 memcpy(name, name + 1, strlen(name + 1) + 1); | |
401 } | 402 } |
402 | 403 |
403 if (strcmp(name, "*") == 0) return MethodMatcher::Any; | 404 if (strcmp(name, "*") == 0) return MethodMatcher::Any; |
404 | 405 |
405 size_t len = strlen(name); | 406 size_t len = strlen(name); |