fix potential crash on task_push_http_transfer

This commit is contained in:
radius 2018-03-18 12:51:20 -05:00
parent a8fc4b204a
commit fd9d8c9512
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);