Merge pull request #6415 from fr500/master

fix potential crash on task_push_http_transfer
This commit is contained in:
Twinaphex 2018-03-18 19:11:42 +01:00 committed by GitHub
commit 4d8d6478f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2874 additions and 852 deletions

View File

@ -2090,7 +2090,7 @@ MSG_HASH(MSG_DISK_EJECTED,
MSG_HASH(MSG_DOWNLOADING,
"Downloading")
MSG_HASH(MSG_INDEX_FILE,
"Index File")
"index")
MSG_HASH(MSG_DOWNLOAD_FAILED,
"Download failed")
MSG_HASH(MSG_ERROR,

File diff suppressed because it is too large Load Diff

View File

@ -249,7 +249,7 @@ static void* task_push_http_transfer_generic(
{
task_finder_data_t find_data;
char tmp[255];
char* s = NULL;
const char* s = NULL;
retro_task_t *t = NULL;
http_handle_t *http = NULL;
@ -298,7 +298,10 @@ static void* task_push_http_transfer_generic(
t->user_data = user_data;
t->progress = -1;
s= ((file_transfer_t*)user_data)->path;
if (user_data != NULL)
s = ((file_transfer_t*)user_data)->path;
else
s = url;
if (strstr(s, ".index"))
{
@ -307,7 +310,7 @@ static void* task_push_http_transfer_generic(
}
else
snprintf(tmp, sizeof(tmp), "%s '%s'",
msg_hash_to_str(MSG_DOWNLOADING), path_basename(s));
msg_hash_to_str(MSG_DOWNLOADING), s);
t->title = strdup(tmp);