MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Chad MILLER Date:August 18 2008 5:08pm
Subject:bzr commit into mysql-5.0 branch (chad:2666) Bug#30394
View as plain text  
#At file:///home/cmiller/work/mysqlbzr/mysql-5.0-bugteam/

 2666 Chad MILLER	2008-08-18
      Bug#30394: Empty HOME environment variable causes several utilities to crash
      
      Tilde expansion could fail when it was to expand to an empty string (such as
      when HOME is set to an empty string), especially on systems where size_t is
      unsigned.
modified:
  mysys/mf_pack.c

=== modified file 'mysys/mf_pack.c'
--- a/mysys/mf_pack.c	2008-07-16 22:58:45 +0000
+++ b/mysys/mf_pack.c	2008-08-18 17:06:27 +0000
@@ -343,7 +343,7 @@ uint unpack_dirname(my_string to, const 
       length-=(uint) (suffix-buff)-1;
       if (length+(h_length= (uint) strlen(tilde_expansion)) <= FN_REFLEN)
       {
-	if (tilde_expansion[h_length-1] == FN_LIBCHAR)
+	if ((h_length > 0) && (tilde_expansion[h_length-1] == FN_LIBCHAR))
 	  h_length--;
 	if (buff+h_length < suffix)
 	  bmove(buff+h_length,suffix,length);

Thread
bzr commit into mysql-5.0 branch (chad:2666) Bug#30394Chad MILLER18 Aug