summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-06-13 12:44:50 (GMT)
committerGitHub <noreply@github.com>2020-06-13 12:44:50 (GMT)
commit26db10a431bf5b55340f4427bf015719e384d306 (patch)
treed35db78d0c68f11f46c5e4db065f9b5c841c6b8e /Python
parent7e57c367d65f3d0219978b465dc00da15ae3724c (diff)
downloadcpython-26db10a431bf5b55340f4427bf015719e384d306.zip
cpython-26db10a431bf5b55340f4427bf015719e384d306.tar.gz
cpython-26db10a431bf5b55340f4427bf015719e384d306.tar.bz2
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')
-rw-r--r--Python/pystate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index 3e10855..b1d0f1c 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -1639,7 +1639,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.