List:Internals« Previous MessageNext Message »
From:Jim Winstead Date:October 7 2005 1:15am
Subject:bk commit into 4.1 tree (jimw:1.2477) BUG#13619
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of jimw. When jimw does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2477 05/10/06 16:15:53 jimw@stripped +3 -0
  Handle errors returned by system crypt() in ENCRYPT(). (Bug #13619)

  sql/item_strfunc.cc
    1.237 05/10/06 16:15:50 jimw@stripped +7 -1
    Handle NULL result from call to crypt().

  mysql-test/t/func_crypt.test
    1.16 05/10/06 16:15:50 jimw@stripped +6 -0
    Add new regression test

  mysql-test/r/func_crypt.result
    1.18 05/10/06 16:15:50 jimw@stripped +3 -0
    Add new results

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	jimw
# Host:	rama.(none)
# Root:	/home/jimw/my/mysql-4.1-13619

--- 1.236/sql/item_strfunc.cc	2005-08-25 12:34:39 -07:00
+++ 1.237/sql/item_strfunc.cc	2005-10-06 16:15:50 -07:00
@@ -1497,7 +1497,13 @@
     salt_ptr= salt_str->c_ptr();
   }
   pthread_mutex_lock(&LOCK_crypt);
-  char *tmp=crypt(res->c_ptr(),salt_ptr);
+  char *tmp= crypt(res->c_ptr(),salt_ptr);
+  if (!tmp)
+  {
+    pthread_mutex_unlock(&LOCK_crypt);
+    null_value= 1;
+    return 0;
+  }
   str->set(tmp,(uint) strlen(tmp),res->charset());
   str->copy();
   pthread_mutex_unlock(&LOCK_crypt);

--- 1.17/mysql-test/r/func_crypt.result	2004-05-13 13:46:57 -07:00
+++ 1.18/mysql-test/r/func_crypt.result	2005-10-06 16:15:50 -07:00
@@ -92,3 +92,6 @@
 1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
 Warnings:
 Note	1003	select password(_latin1'idkfa ') AS `password('idkfa
')`,old_password(_latin1'idkfa') AS `old_password('idkfa')`
+select encrypt('1234','_.');
+encrypt('1234','_.')
+#

--- 1.15/mysql-test/t/func_crypt.test	2005-07-27 17:21:41 -07:00
+++ 1.16/mysql-test/t/func_crypt.test	2005-10-06 16:15:50 -07:00
@@ -49,4 +49,10 @@
 
 explain extended select password('idkfa '), old_password('idkfa');
 
+#
+# Bug #13619: Crash on FreeBSD with salt like '_.'
+#
+--replace_column 1 #
+select encrypt('1234','_.');
+
 # End of 4.1 tests
Thread
bk commit into 4.1 tree (jimw:1.2477) BUG#13619Jim Winstead7 Oct