Author eryksun
Recipients SilentGhost, anshul6, eryksun, paul.moore, r.david.murray, steve.dower, stutzbach, tim.golden, zach.ware
Date 2015-12-03.02:12:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1449108767.98.0.566795750995.issue25778@psf.upfronthosting.co.za>
In-reply-to
Content
Here's a patch for Python 3 that modifies the Reg2Py function in PC/winreg.c for the case of REG_SZ/REG_EXPAND_SZ. The existing code took a conservative approach by only removing a null character at the end of a buffer. I modified it to use wcsnlen instead.

I added a test that depends on setting a string containing null values via winreg.SetValueEx. It could be rewritten using ctypes if it's desired to also prevent the setting of strings that contain null values. Note that the patch also fixes an error in the delete_tree method. The desired access for OpenKey was mistakenly being passed as the "reserved" argument.
History
Date User Action Args
2015-12-03 02:12:48eryksunsetrecipients: + eryksun, paul.moore, tim.golden, stutzbach, r.david.murray, SilentGhost, zach.ware, steve.dower, anshul6
2015-12-03 02:12:47eryksunsetmessageid: <1449108767.98.0.566795750995.issue25778@psf.upfronthosting.co.za>
2015-12-03 02:12:47eryksunlinkissue25778 messages
2015-12-03 02:12:46eryksuncreate