[wxPython-users] Drag n' Drop works different for Unicode and ANSI versions of wxPython

Robin Dunn robin at alldunn.com
Thu Aug 2 19:09:21 PDT 2007


Chris Mellon wrote:
> On 8/2/07, Robin Dunn <robin at alldunn.com> wrote:

> On a side note, there's a potential buffer overflow bug in
> wx.PySimpleDataObject. In GetDataHere, it copies the entire value
> returned by the Python code into the recieving buffer, but the buffer
> might only be as large as GetDataSize bytes. Obviously it would only
> happen with buggy code, and I'm not sure if it'd be practical to fix
> since you'd need to call back up to Python, but I figured I'm mention
> it.

Right, it's assuming that the Python method won't return more bytes than 
self.GetDataSize(), which should also be overridden by the Python class 
so the receiver knows how much to allocate.  But, yeah, it should 
probably be made a bit more robust...

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list