[pywin32-bugs] [ pywin32-Bugs-722082 ] Potential crash in win32clipboard.SetClipboardData
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: SourceForge.net <no...@so...> - 2003-04-15 20:04:39
|
Bugs item #722082, was opened at 2003-04-15 12:22 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=722082&group_id=78018 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Greg Chapman (glchapman) Assigned to: Nobody/Anonymous (nobody) Summary: Potential crash in win32clipboard.SetClipboardData Initial Comment: Consider the following: Python 2.2.2 (#37, Oct 14 2002, 17:02:34) [MSC 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> class crasher(object): pass ... >>> obj = crasher() >>> import win32clipboard >>> win32clipboard.OpenClipboard() >>> win32clipboard.EmptyClipboard() >>> win32clipboard.SetClipboardData(0, obj) (Python Crashes -- same thing happens under 2.3a2). The problem appears to be the assumption (in py_set_clipboard_data) that a non-NULL tp_as_buffer implies a valid bf_getreadbuffer. This is not true; in particular, tp_as_buffer is always non-NULL for new-style classes. I'd suggest using PyObject_AsReadBuffer instead of directly manipulating tp_as_buffer. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=722082&group_id=78018 |