Update of /cvsroot/pywin32/pywin32/win32/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29715/win32/src
Modified Files:
PyUnicode.cpp
Log Message:
PyWinObject_FromBstr no longer crashes if passed NULL.
Index: PyUnicode.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyUnicode.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** PyUnicode.cpp 14 Mar 2007 23:25:58 -0000 1.23
--- PyUnicode.cpp 20 May 2007 10:46:46 -0000 1.24
***************
*** 266,269 ****
--- 266,273 ----
PyObject *PyWinObject_FromBstr(const BSTR bstr, BOOL takeOwnership /*=FALSE*/)
{
+ if (bstr==NULL) {
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
PyObject *ret = PyUnicode_FromWideChar(bstr, SysStringLen(bstr));
if (takeOwnership) SysFreeString(bstr);
|