extra: be more secure
This commit is contained in:
parent
29d6a30adb
commit
dcee33f698
|
@ -41,6 +41,8 @@ extra_win_show(Extra_Theme *theme)
|
|||
char title[1024], author[1024];
|
||||
_selected_theme = theme;
|
||||
|
||||
if (!theme) return;
|
||||
|
||||
snprintf(title, sizeof(title), "<title>%s</title>", theme->name);
|
||||
elm_object_text_set(ui.title, title);
|
||||
|
||||
|
|
|
@ -261,6 +261,8 @@ extra_theme_installed(Extra_Theme *theme)
|
|||
char *path;
|
||||
Eina_Bool exists;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(theme, EINA_FALSE);
|
||||
|
||||
path = extra_theme_install_path_get(theme);
|
||||
exists = ecore_file_exists(path);
|
||||
free(path);
|
||||
|
@ -273,6 +275,8 @@ extra_theme_install_path_get(Extra_Theme *theme)
|
|||
{
|
||||
char *path;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(theme, NULL);
|
||||
|
||||
path = malloc(PATH_MAX * sizeof(char));
|
||||
sprintf(path, "%s/.elementary/themes/%s.edj", eina_environment_home_get(), theme->id);
|
||||
|
||||
|
@ -285,8 +289,7 @@ extra_theme_preview_url_get(Extra_Theme *theme)
|
|||
const char *pattern = "http://" HOSTNAME "/themes/preview/%s.png";
|
||||
char *url;
|
||||
|
||||
if (!theme)
|
||||
return NULL;
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(theme, NULL);
|
||||
|
||||
url = malloc((strlen(pattern) + strlen(theme->id) - 1) * sizeof(char));
|
||||
sprintf(url, pattern, theme->id);
|
||||
|
@ -300,8 +303,7 @@ extra_theme_download_url_get(Extra_Theme *theme)
|
|||
const char *pattern = "http://" HOSTNAME "/themes/%s-%d.edj";
|
||||
char *url;
|
||||
|
||||
if (!theme)
|
||||
return NULL;
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(theme, NULL);
|
||||
|
||||
url = malloc((strlen(pattern) + strlen(theme->id) - 1 + (int)(log10(theme->version))) * sizeof(char));
|
||||
sprintf(url, pattern, theme->id, theme->version);
|
||||
|
|
Loading…
Reference in New Issue