[pywin32-bugs] [ pywin32-Bugs-963802 ] Access violation with bad parameter to GetAttributesOf
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: SourceForge.net <no...@so...> - 2004-05-31 20:35:57
|
Bugs item #963802, was opened at 2004-05-31 12:35 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=963802&group_id=78018 Category: com Group: None Status: Open Resolution: None Priority: 5 Submitted By: Greg Chapman (glchapman) Assigned to: Nobody/Anonymous (nobody) Summary: Access violation with bad parameter to GetAttributesOf Initial Comment: I've discovered that Pythonwin will rash with an access violation shortly after doing somthing like this: >>> from win32com.shell import shell >>> d = shell.SHGetDesktopFolder() >>> t = d.ParseDisplayName(0, None, r"c:\windows\assembly") >>> d.GetAttributesOf(t[1], -1) In particular, if I try to drag a file onto Pythonwin, I get an access violation. t[1] above is a list of strings. Looking at PyObject_FromPIDLArray (called by PyIShellFolder::GetAttributesOf), I note that it mallocs an array (ppidl), and then passes it to PyObject_FreePIDLArray if PyObject_AsPIDL fails (as it will in this case since the elements of t[1] are strings). Since, *ppidl is not initialized before being passed to PyObject_FreePIDLArray, it appears random pointers may be being passed to PyShell_FreeMem, thus corrupting the shell's heap and causing the AV. Anyway, the malloc in PyObject_FromPIDLArray should probably be a calloc. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=963802&group_id=78018 |