[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-10-09 02:23:41
|
Bugs item #963802, was opened at 2004-06-01 06:35 Message generated for change (Comment added) made by mhammond You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=963802&group_id=78018 Category: com Group: None >Status: Closed >Resolution: Fixed 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. ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2004-10-09 12:23 Message: Logged In: YES user_id=14198 This has since been fixed - thanks! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=963802&group_id=78018 |