diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-08-11 19:04:02 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-08-11 19:04:02 (GMT) |
commit | f6c7a8595ea77a2a470309127752432df2f6e872 (patch) | |
tree | 4d1d3bc3277c7ccf7180fc5c3eafcac6ccab050a /Modules | |
parent | 817495a63171d0bbfeaf03f3b5709e1dac399b5c (diff) | |
download | cpython-f6c7a8595ea77a2a470309127752432df2f6e872.zip cpython-f6c7a8595ea77a2a470309127752432df2f6e872.tar.gz cpython-f6c7a8595ea77a2a470309127752432df2f6e872.tar.bz2 |
Issue #12687: Fix a possible buffering bug when unpickling text mode (protocol 0, mostly) pickles.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_pickle.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Modules/_pickle.c b/Modules/_pickle.c index 287f0a3..001360b 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 |