summaryrefslogtreecommitdiffstats
path: root/Python/pystate.c
diff options
context:
space:
mode:
authorAn Long <aisk@users.noreply.github.com>2020-06-13 12:26:01 (GMT)
committerGitHub <noreply@github.com>2020-06-13 12:26:01 (GMT)
commit29c117202e386bad1d66ae336e2fefa1a1809ee0 (patch)
tree4d8c790491cc3b3ff3bcbff7b80ebe2f7853d760 /Python/pystate.c
parent1c209e3b53b6929747fe3b79398bfbaeabb72d92 (diff)
downloadcpython-29c117202e386bad1d66ae336e2fefa1a1809ee0.zip
cpython-29c117202e386bad1d66ae336e2fefa1a1809ee0.tar.gz
cpython-29c117202e386bad1d66ae336e2fefa1a1809ee0.tar.bz2
bpo-40834: Fix truncate when sending str object with channel (GH-20555)
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index 72d8b36..d0cbf5c 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -1726,7 +1726,7 @@ _str_shared(PyObject *obj, _PyCrossInterpreterData *data)
struct _shared_str_data *shared = PyMem_NEW(struct _shared_str_data, 1);
shared->kind = PyUnicode_KIND(obj);
shared->buffer = PyUnicode_DATA(obj);
- shared->len = PyUnicode_GET_LENGTH(obj) - 1;
+ shared->len = PyUnicode_GET_LENGTH(obj);
data->data = (void *)shared;
Py_INCREF(obj);
data->obj = obj; // Will be "released" (decref'ed) when data released.