summaryrefslogtreecommitdiff
path: root/Python/pystate.c
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-06-13 05:44:38 -0700
committerGitHub <noreply@github.com>2020-06-13 05:44:38 -0700
commit94bb4b7db2a4eadd299acede204b087aca30c9a2 (patch)
treec785d9e8ddfed8c07c85f4aa814f9ab0ccdb729c /Python/pystate.c
parent166d7234b5ae07f78feb5ddfb3026fbd2a1a36e2 (diff)
downloadcpython-git-94bb4b7db2a4eadd299acede204b087aca30c9a2.tar.gz
bpo-40834: Fix truncate when sending str object with channel (GH-20555)
(cherry picked from commit 29c117202e386bad1d66ae336e2fefa1a1809ee0) Co-authored-by: An Long <aisk@users.noreply.github.com>
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 071b976ff6..9beefa8e20 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -1708,7 +1708,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.