eryksun added the comment:

In Py2Reg, the REG_BINARY (3) case sets `*retDataSize = 0` when the value is 
None: 

http://hg.python.org/cpython/file/04f714765c13/PC/winreg.c#l766

It doesn't modify *retDataBuf. Then in PySetValueEx, PyMem_DEL is called for 
the uninitialized address in data:

http://hg.python.org/cpython/file/04f714765c13/PC/winreg.c#l1566

Py2Reg in this case could also set `*retDataBuf = NULL`. RegSetValueEx allows 
lpData to be NULL when cbData is 0. 

http://msdn.microsoft.com/en-us/library/ms724923

----------
nosy: +eryksun

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21151>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to