strchr can return NULL, so check validity before tryint to pass NULL

to ecore_file_cp.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2013-08-05 10:37:15 +01:00
parent 8b93eaf4c8
commit 62401c257a
1 changed files with 4 additions and 2 deletions

View File

@ -126,8 +126,10 @@ _ecore_file_download(const char *url,
url += 7;
/* skip hostname */
url = strchr(url, '/');
return ecore_file_cp(url, dst);
if ((url = strchr(url, '/')))
return ecore_file_cp(url, dst);
else
return EINA_FALSE;
}
#ifdef HAVE_CURL
else if ((!strncmp(url, "http://", 7)) || (!strncmp(url, "https://", 8)) ||