Commit 1ac22184 authored by Akira TAGOH's avatar Akira TAGOH

do not pass null pointer to memcpy

parent f3981a8b
......@@ -2109,7 +2109,8 @@ FcConfigXdgCacheHome (void)
ret = malloc (len + 7 + 1);
if (ret)
{
memcpy (ret, home, len);
if (home)
memcpy (ret, home, len);
memcpy (&ret[len], FC_DIR_SEPARATOR_S ".cache", 7);
ret[len + 7] = 0;
}
......@@ -2136,7 +2137,8 @@ FcConfigXdgConfigHome (void)
ret = malloc (len + 8 + 1);
if (ret)
{
memcpy (ret, home, len);
if (home)
memcpy (ret, home, len);
memcpy (&ret[len], FC_DIR_SEPARATOR_S ".config", 8);
ret[len + 8] = 0;
}
......@@ -2163,7 +2165,8 @@ FcConfigXdgDataHome (void)
ret = malloc (len + 13 + 1);
if (ret)
{
memcpy (ret, home, len);
if (home)
memcpy (ret, home, len);
memcpy (&ret[len], FC_DIR_SEPARATOR_S ".local" FC_DIR_SEPARATOR_S "share", 13);
ret[len + 13] = 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment