Annotation of pkgsrc/lang/python27/patches/patch-Modules_socketmodule.c, revision 1.2

1.2     ! obache      1: $NetBSD: patch-Modules_socketmodule.c,v 1.1 2014/02/09 09:02:50 tron Exp $
1.1       tron        2: 
1.2     ! obache      3: Fix CVE-2014-1912. Patch taken from here:
1.1       tron        4: 
                      5: http://hg.python.org/cpython/rev/87673659d8f7
                      6: 
                      7: --- Modules/socketmodule.c.orig        2013-11-10 07:36:41.000000000 +0000
                      8: +++ Modules/socketmodule.c     2014-02-09 08:41:25.000000000 +0000
                      9: @@ -2742,6 +2742,10 @@
                     10:      if (recvlen == 0) {
                     11:          /* If nbytes was not specified, use the buffer's length */
                     12:          recvlen = buflen;
                     13: +    } else if (recvlen > buflen) {
                     14: +        PyErr_SetString(PyExc_ValueError,
                     15: +                        "nbytes is greater than the length of the buffer");
                     16: +        goto error;
                     17:      }
                     18:  
                     19:      readlen = sock_recvfrom_guts(s, buf.buf, recvlen, flags, &addr);

CVSweb <webmaster@jp.NetBSD.org>