]> git.sesse.net Git - vlc/commitdiff
* modules/gui/skins/src/event.cpp, modules/gui/skins/src/event.h:
authorGildas Bazin <gbazin@videolan.org>
Tue, 8 Apr 2003 02:06:13 +0000 (02:06 +0000)
committerGildas Bazin <gbazin@videolan.org>
Tue, 8 Apr 2003 02:06:13 +0000 (02:06 +0000)
    fixed 2 nasty buffer overflows. This fixes the last crashes I've got
    with the skins interface.

modules/gui/skins/src/event.cpp
modules/gui/skins/src/event.h

index edc72030b9b1f1f2cec985f5749af35e96ce0bfa..e4dc01cd3c5c7496db949c45ad8a1a55243e4378 100644 (file)
@@ -2,7 +2,7 @@
  * event.cpp: Event class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: event.cpp,v 1.3 2003/04/01 12:24:54 gbazin Exp $
+ * $Id: event.cpp,v 1.4 2003/04/08 02:06:13 gbazin Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -96,7 +96,7 @@ void Event::PostSynchroMessage( bool autodelete )
 //---------------------------------------------------------------------------
 void Event::PostTextMessage( string text )
 {
-    char *txt = new char[text.size()];
+    char *txt = new char[text.size()+1];
     strcpy( txt, text.c_str() );
     OSAPI_PostMessage( NULL, CTRL_SET_TEXT, (unsigned int)this, (long)txt );
 }
index dcb736937f2cfef0f377e5f4e30514c25c19d8dc..db87282aee3090c2318d849019421c1a30e25948 100644 (file)
@@ -2,7 +2,7 @@
  * event.h: Event class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: event.h,v 1.2 2003/03/20 09:29:07 karibu Exp $
+ * $Id: event.h,v 1.3 2003/04/08 02:06:13 gbazin Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -38,7 +38,7 @@ using namespace std;
 // VLC specific messages
 //---------------------------------------------------------------------------
 
-#define MAX_EVENT_SIZE 20
+#define MAX_EVENT_SIZE 30
 #define MAX_PARAM_SIZE 20
 
 #define VLC_MESSAGE         (WM_APP)