diff options
author | Fred Drake <fdrake@acm.org> | 2000-04-04 18:17:35 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2000-04-04 18:17:35 (GMT) |
commit | 56a87a090558ea69a9857d05c3dcf286801bbd7a (patch) | |
tree | 38c442256320d1f930d5ee25c3a2136539f2da10 /Lib/gzip.py | |
parent | 7d68690d8d8a3207c9432b38df58d2ebdd54d9da (diff) | |
download | cpython-56a87a090558ea69a9857d05c3dcf286801bbd7a.zip cpython-56a87a090558ea69a9857d05c3dcf286801bbd7a.tar.gz cpython-56a87a090558ea69a9857d05c3dcf286801bbd7a.tar.bz2 |
Patch from Hrvoje Niksic <hniksic@iskon.hr>:
The bug is in mmap_read_line_method(), and its loop that searches for
newlines. After the loop reaches EOF, eol is incremented and points
after the end of the memory. This results in readline() method
sometimes picking up and returning a byte after the end of the string.
This is usually a bogus \0, but it could cause SIGSEGV if it's after
the end of the page).
The patch fixes the problem. Also, it uses memchr() for finding a
character, which is in fact the "strnchr" the comment is asking for.
memchr() is already used in Python sources, so there should be no
portability problems.
Diffstat (limited to 'Lib/gzip.py')
0 files changed, 0 insertions, 0 deletions