summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/jvmti-agents/wrapagentproperties/wrapagentproperties.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/jvmti-agents/wrapagentproperties/wrapagentproperties.cc b/tools/jvmti-agents/wrapagentproperties/wrapagentproperties.cc
index 39cb20acf2..b2dcaabcfe 100644
--- a/tools/jvmti-agents/wrapagentproperties/wrapagentproperties.cc
+++ b/tools/jvmti-agents/wrapagentproperties/wrapagentproperties.cc
@@ -28,6 +28,7 @@
#include <sstream>
#include <string>
#include <vector>
+#include <cstring>
namespace wrapagentproperties {
@@ -185,7 +186,7 @@ struct ExtraJvmtiInterface : public jvmtiInterface_1_ {
if (res != JVMTI_ERROR_NONE) {
return res;
}
- strcpy(out_prop_ptr[i], p.c_str());
+ memcpy(out_prop_ptr[i], p.c_str(), p.size() + 1);
i++;
}
CHECK_EQ(i, *cnt);