components/python/python26/patches/Python26-36-buffer-overflow.patch
author John Beck <John.Beck@Oracle.COM>
Wed, 24 Sep 2014 06:44:55 -0700
changeset 2113 38667c45630e
permissions -rw-r--r--
19672848 problem in UTILITY/PYTHON

This patch comes from upstream: http://bugs.python.org/issue21831

--- a/Objects/bufferobject.c
+++ b/Objects/bufferobject.c
@@ -88,7 +88,7 @@ get_buf(PyBufferObject *self, void **ptr
             *size = count;
         else
             *size = self->b_size;
-        if (offset + *size > count)
+        if (*size > count - offset)
             *size = count - offset;
     }
     return 1;