Author: toshok
Date: 2007-06-19 13:41:01 -0400 (Tue, 19 Jun 2007)
New Revision: 80210

Modified:
   trunk/moon/plugin/ChangeLog
   trunk/moon/plugin/plugin.cpp
Log:
2007-06-19  Chris Toshok  <[EMAIL PROTECTED]>

        * plugin.cpp (UpdateSourceByReference): use g_strlcpy/g_strlcat
        instead of strcpy/strcat (which was actually walking off the end
        of the string).  also, create the char array of the right size.



Modified: trunk/moon/plugin/ChangeLog
===================================================================
--- trunk/moon/plugin/ChangeLog 2007-06-19 17:37:38 UTC (rev 80209)
+++ trunk/moon/plugin/ChangeLog 2007-06-19 17:41:01 UTC (rev 80210)
@@ -1,3 +1,9 @@
+2007-06-19  Chris Toshok  <[EMAIL PROTECTED]>
+
+       * plugin.cpp (UpdateSourceByReference): use g_strlcpy/g_strlcat
+       instead of strcpy/strcat (which was actually walking off the end
+       of the string).  also, create the char array of the right size.
+
 2007-06-19  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * Makefile.am : we need uninstall-plugin to avoid

Modified: trunk/moon/plugin/plugin.cpp
===================================================================
--- trunk/moon/plugin/plugin.cpp        2007-06-19 17:37:38 UTC (rev 80209)
+++ trunk/moon/plugin/plugin.cpp        2007-06-19 17:41:01 UTC (rev 80210)
@@ -247,10 +247,11 @@
                return;
        }
 
-       char jscript [strlen (value) + 5];
-       strcpy (jscript, value);
-       strcat (jscript, ".text");
+       char jscript[strlen (value) + strlen (".text") + 1];
 
+       g_strlcpy (jscript, value, sizeof(jscript));
+       g_strlcat (jscript, ".text", sizeof(jscript));
+
        reference.utf8characters = jscript;
        reference.utf8length = strlen (jscript);
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to