From: Georg Brandl Date: Thu, 29 Sep 2005 20:49:21 +0000 (+0000) Subject: backport patch [ 1300515 ] xdrlib.py: pack_fstring() did not use null bytes for padding X-Git-Tag: v2.4.3c1~265 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2c89f1a4f0ef21ffc4c0b603ad42b7eddcac5a7b;p=thirdparty%2FPython%2Fcpython.git backport patch [ 1300515 ] xdrlib.py: pack_fstring() did not use null bytes for padding --- diff --git a/Lib/xdrlib.py b/Lib/xdrlib.py index 112309036dcf..e13ae5c813e5 100644 --- a/Lib/xdrlib.py +++ b/Lib/xdrlib.py @@ -79,8 +79,8 @@ class Packer: def pack_fstring(self, n, s): if n < 0: raise ValueError, 'fstring size must be nonnegative' - n = ((n+3)/4)*4 data = s[:n] + n = ((n+3)/4)*4 data = data + (n - len(data)) * '\0' self.__buf.write(data) diff --git a/Misc/NEWS b/Misc/NEWS index d2088cd88cb6..c2b32d822f8f 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -17,6 +17,9 @@ Extension Modules Library ------- +- Patch #1300515: xdrlib.py: Fix pack_fstring() to really use null bytes + for padding. + - Bug #1296004: httplib.py: Limit maximal amount of data read from the socket to avoid a MemoryError on Windows.