summaryrefslogtreecommitdiffstats
path: root/Modules/_pickle.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-08-11 19:15:53 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-08-11 19:15:53 (GMT)
commitfdf4a274220d3167234792e91f29eb935c78e15d (patch)
treed53b0ba4d92dc42397796625ff1e262caada3d14 /Modules/_pickle.c
parent49281076c1dcc3d8d7b5592a49dd9c65c1e6b8a4 (diff)
parentf6c7a8595ea77a2a470309127752432df2f6e872 (diff)
downloadcpython-fdf4a274220d3167234792e91f29eb935c78e15d.zip
cpython-fdf4a274220d3167234792e91f29eb935c78e15d.tar.gz
cpython-fdf4a274220d3167234792e91f29eb935c78e15d.tar.bz2
Issue #12687: Fix a possible buffering bug when unpickling text mode (protocol 0, mostly) pickles.
Diffstat (limited to 'Modules/_pickle.c')
-rw-r--r--Modules/_pickle.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index 06bce1e..f147e3e 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -1034,9 +1034,8 @@ _Unpickler_Readline(UnpicklerObject *self, char **result)
num_read = _Unpickler_ReadFromFile(self, READ_WHOLE_LINE);
if (num_read < 0)
return -1;
- *result = self->input_buffer;
self->next_read_idx = num_read;
- return num_read;
+ return _Unpickler_CopyLine(self, self->input_buffer, num_read, result);
}
/* If we get here, we've run off the end of the input string. Return the