From aa93517de8b5e2b41644a22ae81ddec4f5d72991 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Thu, 29 Sep 2005 20:49:16 +0000 Subject: patch [ 1300515 ] xdrlib.py: pack_fstring() did not use null bytes for padding --- Lib/xdrlib.py | 2 +- Misc/NEWS | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/xdrlib.py b/Lib/xdrlib.py index d9d2120..47cc22b 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 ec70b95..3c06f4e 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -242,6 +242,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. -- cgit v0.12