Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. Read more...

Bug #852927

Missing breaks in universal_value_from_str()

Added by Marko Lindqvist over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Category:
General
Sprint/Milestone:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

There's several cases where universal_value_from_str() lacks 'break;' if some conditional does not hold.

case VUT_aaa:
if (hopefully_true) {
return;
}
/* else. MISSING BREAK */
case VUT_bbb:


Related issues

Related to Freeciv - Feature #852929: Enable -Wimplicit-fallthroughIn Progress

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

History

#1 Updated by Marko Lindqvist over 1 year ago

  • Status changed from New to In Progress
  • Sprint/Milestone set to 2.6.2

In S2_6 equivalent function is universal_by_rule_name() and it has just one break missing.

#3 Updated by Marko Lindqvist over 1 year ago

#4 Updated by Jacob Nevins over 1 year ago

In S2_6 equivalent function is universal_by_rule_name() and it has just one break missing.

The missing break is in case VUT_SPECIALIST, followed by VUT_MINSIZE.

I think it's mostly harmless: if a valid specialist name is supplied, we won't hit the bug. If an invalid specialist name is supplied, the function will still correctly fail, unless the invalid specialist name is numeric, in which case something worse will happen, probably a crash. (The server segfaulted when I tried it.)

So I think the effect is limited to "Specialist", "1", "Local" in a ruleset probably causing a crash on load, rather than a clean error (iff your ruleset isn't so weird as to have a specialist called "1").

I think S2_5 has the same bug.

I agree it's not worth holding up the next batch of releases for this.

#5 Updated by Marko Lindqvist over 1 year ago

  • Status changed from Resolved to Closed
  • Assignee set to Marko Lindqvist

Also available in: Atom PDF