Bugs item #722082, was opened at 2003-04-16 06:22
Message generated for change (Comment added) made by mhammond
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=722082&group_id=78018
Category: None
Group: None
>Status: Closed
>Resolution: Fixed
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.
----------------------------------------------------------------------
>Comment By: Mark Hammond (mhammond)
Date: 2003-07-29 16:56
Message:
Logged In: YES
user_id=14198
Fixed by Roger Upole in rev 1.11
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=722082&group_id=78018
|