I'm attaching a patch for some minor bugs in the e17.
Please take a look at attached patch.
01. missing E_FREE(inst)
File: src/bin/e_exec.c: 347
Function: _e_exec_cb_exec
02. missing null check
File: src/bin/e_fm.c: 10173
Function: _e_fm_error_dialog
I'm not sure, but all other codes always check the return
value of e_fm2_op_registry_entry_get except here.
03. missing free(slave)
File: src/bin/e_fm_ipc.c: 804
Function: _e_fm_ipc_slave_run
04. eina_list_remove after free
File: src/bin/e_fm/e_fm_ipc.c :1325
Function: _e_fm_ipc_cb_fop_trash_idler
05. invalid check for _udisks_del, it might be _udisks_chg.
File: src/bin/e_fm/e_fm_main_udisks.c : 162
Function: _e_fm_main_udisks_test
06. uninitialized gx and gy values
File: src/bin/e_gadcon_popup.c: 172
Function: _e_gadcon_popup_position
These could be changed in e_gadcon_client_geometry_get
if gcc->o_base is null.
07. unnecessary code 'evas = e_win_evas_get(dia->win)'
File: src/bin/e_import_config_dialog.c: 456
Function: e_import_config_dialog_show
08. missing free(sizes)
src/bin/e_randr_11_serialization.c: 136
Function: _11_try_restore_configuration()
09. unnecessary variable output_info
File: src/bin/e_randr_12.c: 560
Function: _output_property_change_event_cb
10. eina_list_remove after free
File: src/bin/e_randr_12_serialization.c : 357
Function: _12_serialized_setup_update
11. no check of the return value of symlink.
File: src/bin/e_widget_fsel.c: 84
Function: _e_wid_fsel_favorites_add
12. no evr->var check before comparing string values
File: src/modules/conf_applications/e_int_config_defapps.c: 432
Function: _basic_apply
13. missing error message or check return value of edje_file_group_exists
File: src/modules/conf_theme/e_int_config_theme.c: 333
Function: _open_test_cb
Anyway, I've added e_util_dialog_show if failed. Is it okay?
14. missing index range check
File: src/modules/gadman/e_mod_config.c: 153
Function: _cb_config
It could read negative array index, because return value of
e_widget_ilist_selected_get might be negative.
BR,
Gwanglim
SVN revision: 80020
penv_display_length = strlen(penv_display);
/* Check for insane length for DISPLAY env */
- if (penv_display_length + 32 > 4096) return NULL;
+ if (penv_display_length + 32 > 4096)
+ {
+ E_FREE(inst);
+ return NULL;
+ }
/* buf2 = '.%i' */
*buf2 = '.';
id = (intptr_t*)(long)pid;
ere = e_fm2_op_registry_entry_get(pid);
+ if (!ere) return NULL;
sd = evas_object_smart_data_get(ere->e_fm);
while (sd->realpath)
{
if (!slave) return 0;
command = eina_stringshare_add(_e_fm_ipc_prepare_command(type, args));
- if (!command) return 0;
+ if (!command)
+ {
+ free(slave);
+ return 0;
+ }
slave->id = id;
slave->exe = ecore_exe_pipe_run(command, ECORE_EXE_PIPE_WRITE | ECORE_EXE_PIPE_READ | ECORE_EXE_PIPE_ERROR, slave);
if (trash_dir) eina_stringshare_del(trash_dir);
eina_stringshare_del(fop->src);
eina_stringshare_del(fop->dst);
- free(fop);
_e_fops = eina_list_remove(_e_fops, fop);
+ free(fop);
return ECORE_CALLBACK_CANCEL;
}
E_UDISKS_PATH,
E_UDISKS_BUS,
"DeviceRemoved", (E_DBus_Signal_Cb)_e_fm_main_udisks_cb_dev_del, NULL);
- if (!_udisks_del)
+ if (!_udisks_chg)
_udisks_chg = e_dbus_signal_handler_add(_e_fm_main_udisks_conn, E_UDISKS_BUS,
E_UDISKS_PATH,
E_UDISKS_BUS,
static void
_e_gadcon_popup_position(E_Gadcon_Popup *pop)
{
- Evas_Coord gx, gy, gw, gh, zw, zh, zx, zy, px, py;
+ Evas_Coord gx = 0, gy = 0, gw, gh, zw, zh, zx, zy, px, py;
/* Popup positioning */
e_gadcon_client_geometry_get(pop->gcc, &gx, &gy, &gw, &gh);
e_object_del_attach_func_set(E_OBJECT(dia), _e_import_config_dia_del);
e_win_delete_callback_set(dia->win, _e_import_config_dialog_win_del);
- evas = e_win_evas_get(dia->win);
-
import->method = IMPORT_SCALE_ASPECT_OUT;
import->external = 0;
import->quality = 90;
Eina_Bool
_11_try_restore_configuration(void)
{
- Ecore_X_Randr_Screen_Size_MM *stored_size, *sizes;
+ Ecore_X_Randr_Screen_Size_MM *stored_size, *sizes = NULL;
int i = 0, nsizes;
#define SIZE_EQUAL(size) \
}
#undef SIZE_EQUAL
+ free(sizes);
+
return EINA_FALSE;
}
_output_property_change_event_cb(void *data __UNUSED__, int type, void *ev)
{
Ecore_X_Event_Randr_Output_Property_Notify *opce = (Ecore_X_Event_Randr_Output_Property_Notify *)ev;
- E_Randr_Output_Info *output_info;
EINA_SAFETY_ON_TRUE_RETURN_VAL(E_RANDR_12_NO, ECORE_CALLBACK_RENEW);
EINA_SAFETY_ON_TRUE_RETURN_VAL((type != ECORE_X_EVENT_RANDR_OUTPUT_PROPERTY_NOTIFY), ECORE_CALLBACK_RENEW);
Ecore_X_Time time;
Ecore_X_Randr_Property_Change state;
*/
- EINA_SAFETY_ON_FALSE_RETURN_VAL((output_info = _12_screen_info_output_info_get(opce->output)), ECORE_CALLBACK_RENEW);
+ EINA_SAFETY_ON_FALSE_RETURN_VAL((_12_screen_info_output_info_get(opce->output)), ECORE_CALLBACK_RENEW);
return ECORE_CALLBACK_RENEW;
}
if ((ss_12 = _matching_serialized_setup_get(setups_12)))
{
INF("E_RANDR: Found stored configuration that matches current setup. It was created at %f. Freeing it...", ss_12->timestamp);
- _12_serialized_setup_free(ss_12);
setups_12 = eina_list_remove(setups_12, ss_12);
+ _12_serialized_setup_free(ss_12);
}
}
ss_12 = _12_serialized_setup_new();
struct stat st;
FILE *f;
size_t len;
+ int ret;
wd = data1;
current_path = e_fm2_real_path_get(wd->o_files_fm);
ecore_file_file_get(current_path));
if (len >= sizeof(buf)) return;
if (stat(buf, &st) < 0)
- symlink(current_path, buf);
+ ret = symlink(current_path, buf);
else
{
int i = 1, maxlen;
i++;
}
while (stat(buf, &st) == 0);
- symlink(current_path, buf);
+ ret = symlink(current_path, buf);
}
+ if (ret != 0) return;
fn = ecore_file_file_get(buf);
len = strlen(fn) + 1;
fname = alloca(len);
{
EINA_LIST_FOREACH(e_config->env_vars, l, evr)
{
- if (!strcmp(evr->var, "BROWSER"))
+ if (!e_util_strcmp(evr->var, "BROWSER"))
{
e_config->env_vars = eina_list_remove_list(e_config->env_vars, l);
if (evr->val) eina_stringshare_del(evr->val);
static void
_open_test_cb(void *file)
{
- edje_file_group_exists(eet_file_get(file), "e/desktop/background");
+ if (!edje_file_group_exists(eet_file_get(file), "e/desktop/background"))
+ e_util_dialog_show(_("Theme File Error"),
+ _("%s file does not contain e/desktop/background group!"),
+ (char*)file);
}
static void
E_Gadcon *gc;
x = e_widget_ilist_selected_get(cfdata->o_avail);
+ if (x < 0) return;
+
EINA_LIST_FOREACH(Man->gadcons[x], l, gc)
{
if (gc->zone != cfdata->cfd->dia->win->border->zone) continue;