Commit ac0518ae142312ca15bffff51afe66442d4e0ac9

Authored by Perry Werneck
1 parent f002735d
Exists in master and in 1 other branch develop

Validating action names.

src/terminal/actions/lib3270.c
... ... @@ -120,7 +120,13 @@
120 120 for(ix = 0; actions[ix].name; ix++) {
121 121  
122 122 GAction *action = g_action_new_from_lib3270(&actions[ix]);
123   - g_action_map_add_action(action_map,action);
  123 +
  124 + if(!g_action_get_name(action)) {
  125 + g_warning("Action \"%s\" is invalid",actions[ix].name);
  126 + } else {
  127 + g_action_map_add_action(action_map,action);
  128 + }
  129 +
124 130  
125 131 }
126 132  
... ...
src/terminal/actions/table.c
... ... @@ -344,7 +344,12 @@
344 344  
345 345 action->info = (const LIB3270_PROPERTY *) &actions[ix];
346 346 action->activate = activate_v3270;
347   - g_action_map_add_action(action_map,G_ACTION(action));
  347 +
  348 + if(!g_action_get_name(G_ACTION(action))) {
  349 + g_warning("Action \"%s\" is invalid",actions[ix].name);
  350 + } else {
  351 + g_action_map_add_action(action_map,G_ACTION(action));
  352 + }
348 353  
349 354 }
350 355  
... ...