Annotation of pkgsrc/lang/python27/patches/patch-Lib_tarfile.py, revision 1.2

1.2     ! mgorny      1: $NetBSD: patch-Lib_tarfile.py,v 1.1 2020/09/20 11:06:23 mgorny Exp $
        !             2: 
        !             3: bpo-39017 (CVE-2019-20907): infinite loop in tarfile.py
        !             4: 
        !             5: taken from:
        !             6: https://gitweb.gentoo.org/fork/cpython.git/commit/?h=gentoo-2.7-vanilla&id=893e6e3aee483d262df70656a68f63f601720fcd
1.1       mgorny      7: 
                      8: --- Lib/tarfile.py.orig        2020-04-19 21:13:39.000000000 +0000
                      9: +++ Lib/tarfile.py
                     10: @@ -1400,6 +1400,8 @@ class TarInfo(object):
                     11:  
                     12:              length, keyword = match.groups()
                     13:              length = int(length)
                     14: +            if length == 0:
                     15: +                raise InvalidHeaderError("invalid header")
                     16:              value = buf[match.end(2) + 1:match.start(1) + length - 1]
                     17:  
                     18:              keyword = keyword.decode("utf8")

CVSweb <webmaster@jp.NetBSD.org>