mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 10:14:19 +01:00
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.
This commit is contained in:
parent
2941024852
commit
747c3c2b2a
1 changed files with 1 additions and 1 deletions
|
@ -343,7 +343,7 @@ uint unpack_dirname(my_string to, const char *from)
|
|||
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);
|
||||
|
|
Loading…
Add table
Reference in a new issue