components/python/python26/patches/Python26-36-buffer-overflow.patch
branchs11u2-sru
changeset 3360 e8974270855a
equal deleted inserted replaced
3358:82eae83882e6 3360:e8974270855a
       
     1 This patch comes from upstream: http://bugs.python.org/issue21831
       
     2 
       
     3 --- a/Objects/bufferobject.c
       
     4 +++ b/Objects/bufferobject.c
       
     5 @@ -88,7 +88,7 @@ get_buf(PyBufferObject *self, void **ptr
       
     6              *size = count;
       
     7          else
       
     8              *size = self->b_size;
       
     9 -        if (offset + *size > count)
       
    10 +        if (*size > count - offset)
       
    11              *size = count - offset;
       
    12      }
       
    13      return 1;