List:Commits« Previous MessageNext Message »
From:vasil.dimov Date:August 3 2011 11:25am
Subject:bzr commit into mysql-trunk branch (vasil.dimov:3340)
View as plain text  
#At file:///usr/local/devel/bzrroot/server/mysql-trunk/ based on revid:marc.alff@stripped

 3340 Vasil Dimov	2011-08-03
      Fix Bug 12813354 - PLUGIN_VAR_MEMALLOC WITHOUT VALIDATION FUNC CRASHES
      IF THE VALUE IS SET TO NULL
      
      Do not try to strdup() the string if the value is NULL. In this case
      *(char **)tgt has already been assigned NULL at the start of the function.
      
      Reviewed by:	magne.mahre (via IM)

    modified:
      sql/sql_plugin.cc
=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc	revid:marc.alff@stripped
+++ b/sql/sql_plugin.cc	revid:vasil.dimov@stripped
@@ -2279,7 +2279,9 @@ static void update_func_str(THD *thd, st
   *(char **)tgt= *(char **) save;
   if (var->flags & PLUGIN_VAR_MEMALLOC)
   {
-    *(char **)tgt= my_strdup(*(char **) save, MYF(0));
+    if (*(char **) save != NULL) {
+      *(char **)tgt= my_strdup(*(char **) save, MYF(0));
+    }
     my_free(old);
   }
 }


Attachment: [text/bzr-bundle] bzr/vasil.dimov@oracle.com-20110803112301-y43ownutt52unmfu.bundle
Thread
bzr commit into mysql-trunk branch (vasil.dimov:3340) vasil.dimov4 Aug