• Alexey Kopytov's avatar
    Bug #44767: invalid memory reads in password() and · 2df531fd
    Alexey Kopytov authored
                old_password() functions   
    The PASSWORD() and OLD_PASSWORD() functions could lead to   
    memory reads outside of an internal buffer when used with BLOB   
    arguments.   
      
    String::c_ptr() assumes there is at least one extra byte  
    in the internally allocated buffer when adding the trailing  
    '\0'.  This, however, may not be the case when a String object  
    was initialized with externally allocated buffer.  
      
    The bug was fixed by adding an additional "length" argument to  
    make_scrambled_password_323() and make_scrambled_password() in  
    order to avoid String::c_ptr() calls for  
    PASSWORD()/OLD_PASSWORD().  
      
    However, since the make_scrambled_password[_323] functions are  
    a part of the client library ABI, the functions with the new  
    interfaces were implemented with the 'my_' prefix in their  
    names, with the old functions changed to be wrappers around  
    the new ones to maintain interface compatibility.  
    2df531fd
func_crypt.result 2.72 KB