mirror of
https://github.com/python/cpython.git
synced 2024-11-24 10:24:35 +08:00
patch [ 1300515 ] xdrlib.py: pack_fstring() did not use null bytes for padding
This commit is contained in:
parent
1aa74ee5c5
commit
aa93517de8
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user