summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Objects/stringobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index 657b200..992f3d9 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -144,7 +144,7 @@ PyString_FromString(const char *str)
#ifdef INTERN_STRINGS
op->ob_sinterned = NULL;
#endif
- strcpy(op->ob_sval, str);
+ memcpy(op->ob_sval, str, size+1);
#ifndef DONT_SHARE_SHORT_STRINGS
if (size == 0) {
PyObject *t = (PyObject *)op;