[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14164] trunk/blender/intern/ghost/intern/ GHOST_SystemX11.cpp: Added null check to prevent crashing on paste.

Campbell Barton ideasman42 at gmail.com
Tue Mar 18 19:53:19 CET 2008


This problem seems to be specific to how SciTE copies text to the
clipboard, a quick look into it didn't show any obvious answers.
But gedit works ok, and copying text from scite to gedit then into
blender works too.

if anyones interested in testing on ubuntu, scite is in the repo, its
very easy to test. Just using Ctrl+C in scite and Ctrl+V in Blender.

On Tue, Mar 18, 2008 at 5:12 PM, Campbell Barton <ideasman42 at gmail.com> wrote:
> Revision: 14164
>           http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14164
>  Author:   campbellbarton
>  Date:     2008-03-18 17:12:43 +0100 (Tue, 18 Mar 2008)
>
>  Log Message:
>  -----------
>  Added null check to prevent crashing on paste.
>  Should look into why XGetWindowProperty isnt working also.
>
>  Modified Paths:
>  --------------
>     trunk/blender/intern/ghost/intern/GHOST_SystemX11.cpp
>
>  Modified: trunk/blender/intern/ghost/intern/GHOST_SystemX11.cpp
>  ===================================================================
>  --- trunk/blender/intern/ghost/intern/GHOST_SystemX11.cpp       2008-03-18 14:49:31 UTC (rev 14163)
>  +++ trunk/blender/intern/ghost/intern/GHOST_SystemX11.cpp       2008-03-18 16:12:43 UTC (rev 14164)
>  @@ -990,10 +990,12 @@
>                 XNextEvent(m_display, &xevent);
>                 if(xevent.type == SelectionNotify) {
>                         if(XGetWindowProperty(m_display, m_window, xevent.xselection.property, 0L, 4096L, False, AnyPropertyType, &rtype, &bits, &len, &bytes, &data) == Success) {
>  -                               tmp_data = (unsigned char*) malloc(strlen((char*)data));
>  -                               strcpy((char*)tmp_data, (char*)data);
>  -                               XFree(data);
>  -                               return (GHOST_TUns8*)tmp_data;
>  +                               if (data) {
>  +                                       tmp_data = (unsigned char*) malloc(strlen((char*)data));
>  +                                       strcpy((char*)tmp_data, (char*)data);
>  +                                       XFree(data);
>  +                                       return (GHOST_TUns8*)tmp_data;
>  +                               }
>                         }
>                         return NULL;
>                 }
>
>
>  _______________________________________________
>  Bf-blender-cvs mailing list
>  Bf-blender-cvs at blender.org
>  http://lists.blender.org/mailman/listinfo/bf-blender-cvs
>



More information about the Bf-blender-cvs mailing list