This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: xdrlib.py: pack_fstring() did not use null bytes for padding
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: dq_searchlores, georg.brandl
Priority: normal Keywords: patch

Created on 2005-09-23 09:37 by dq_searchlores, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
xdrlib_patch.diff dq_searchlores, 2005-09-23 09:37 patch to xdrlib.py
Messages (2)
msg48764 - (view) Author: Don Quijote (dq_searchlores) Date: 2005-09-23 09:37
According to the documentation, null shall be used as
padding byte. But, as the test below shows, instead of
null, additional trailing characters of the original
string are used. This is also wrong according to the
related RFC 1014 (and RFC 1832).

This is tested on Python 2.4.1 (#65, Mar 30 2005,
09:13:57) [MSC v.1310 32 bit (Intel)] on win32

>>> import xdrlib
>>> p = xdrlib.Packer()
>>> p.pack_fstring(2,"abcdef")
>>> p.get_buffer()
'abcd'

I am expecting 'ab\0\0'

This change does not have any impact on unpack_fstring().

The patch is done against the current CVS tree.
The patch does not add nor change any functionality.
msg48765 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2005-09-29 20:49
Logged In: YES 
user_id=1188172

Thanks for the patch, committed in xdrlib.py r1.18, r1.16.4.1
History
Date User Action Args
2022-04-11 14:56:13adminsetgithub: 42407
2005-09-23 09:37:50dq_searchlorescreate