List:Commits« Previous MessageNext Message »
From:Harin Vadodaria Date:September 27 2012 4:51am
Subject:bzr push into mysql-5.6 branch (harin.vadodaria:4339 to 4340) Bug#14603714
View as plain text  
 4340 Harin Vadodaria	2012-09-27
      Bug#14603714: CRASH OBSERVED IN SQL_ACL.CC WHILE FREEING
                    UP THE MEMORY
      
      Description: In sql_acl.cc server_mpvio_info() calls
                   X509_NAME_oneline() function. This functions
                   returns pointer to a char string.When mysql
                   is using OpenSSL, OpenSSL library uses
                   OPENSSL_alloc() function to allocate memory
                   for char string. However in sql_acl.cc,
                   memory is freed using free(). Correct way to
                   free such memory is to call OPENSSL_free()
                   function. This change addresses this issue
                   and replaces call to free() with
                   OPENSSL_free() when memory is allocated through
                   X509_NAME_oneline() in sql_acl.cc.

    modified:
      sql/sql_acl.cc
 4339 Akhila Maddukuri	2012-09-27
      Description:
      -----------
      After compiling from source, during make test I got the following error:
      
      test main.loaddata failed with error
      CURRENT_TEST: main.loaddata
      mysqltest: At line 592: query 'LOAD DATA INFILE 'tmpp.txt' INTO TABLE t1
      CHARACTER SET ucs2
      (@b) SET a=REVERSE(@b)' failed: 1115: Unknown character set: 'ucs2'
      
      I noticed other tests are skipped because of no ucs2
      main.mix2_myisam_ucs2                    [ skipped ]  Test requires:'
      have_ucs2'
      
      Should main.loaddata be skipped if there is no ucs2
      
      How To Repeat:
      -------------
      Run make test on compiled source that doesn't have ucs2
      
      Suggested fix:
      -------------
      the failing piece of the test should be moved from mysql-test/t/loaddata.test to
      mysql-test/t/ctype_ucs.test.

    modified:
      mysql-test/r/loaddata.result
=== modified file 'sql/sql_acl.cc'
--- a/sql/sql_acl.cc	2012-09-25 10:37:54 +0000
+++ b/sql/sql_acl.cc	2012-09-27 04:48:29 +0000
@@ -10390,11 +10390,11 @@ static bool acl_check_ssl(THD *thd, cons
         if (log_warnings)
           sql_print_information("X509 issuer mismatch: should be '%s' "
                             "but is '%s'", acl_user->x509_issuer, ptr);
-        free(ptr);
+        OPENSSL_free(ptr);
         X509_free(cert);
         return 1;
       }
-      free(ptr);
+      OPENSSL_free(ptr);
     }
     /* X509 subject is specified, we check it .. */
     if (acl_user->x509_subject)
@@ -10407,11 +10407,11 @@ static bool acl_check_ssl(THD *thd, cons
         if (log_warnings)
           sql_print_information("X509 subject mismatch: should be '%s' but is '%s'",
                           acl_user->x509_subject, ptr);
-        free(ptr);
+        OPENSSL_free(ptr);
         X509_free(cert);
         return 1;
       }
-      free(ptr);
+      OPENSSL_free(ptr);
     }
     X509_free(cert);
     return 0;

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.6 branch (harin.vadodaria:4339 to 4340) Bug#14603714Harin Vadodaria28 Sep