components/python/python27/patches/19-recvfrom_into.patch
changeset 1710 7af9a5a0f495
child 1914 00e8dbcb9b1e
equal deleted inserted replaced
1709:beec163c6a30 1710:7af9a5a0f495
       
     1 # Fix from upstream: http://bugs.python.org/issue20246
       
     2 
       
     3 --- Python-2.6.8/Modules/socketmodule.c	2012-04-09 16:07:34.000000000 -0700
       
     4 +++ Python-2.6.8/Modules/socketmodule.c	2014-02-12 15:27:10.106066138 -0800
       
     5 @@ -2677,6 +2677,13 @@
       
     6          recvlen = buflen;
       
     7      }
       
     8  
       
     9 +    /* Check if the buffer is large enough */
       
    10 +    if (buflen < recvlen) {
       
    11 +        PyErr_SetString(PyExc_ValueError,
       
    12 +                        "buffer too small for requested bytes");
       
    13 +        goto error;
       
    14 +    }
       
    15 +
       
    16      readlen = sock_recvfrom_guts(s, buf.buf, recvlen, flags, &addr);
       
    17      if (readlen < 0) {
       
    18          /* Return an error */