components/python/python27/patches/19-recvfrom_into.patch
changeset 1954 32663e59626d
parent 1953 5c1face45dc8
child 1955 9710ffab40cb
equal deleted inserted replaced
1953:5c1face45dc8 1954:32663e59626d
     1 # Fix from upstream: http://bugs.python.org/issue20246
       
     2 
       
     3 --- Python-2.7.6/Modules/socketmodule.c.~1~	2013-11-09 23:36:41.000000000 -0800
       
     4 +++ Python-2.7.6/Modules/socketmodule.c	2014-05-14 13:48:12.538122707 -0700
       
     5 @@ -2744,6 +2744,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 */