Race Condition in Switch

From Guidance Share

Jump to: navigation, search

Contents

Description

If the variable which is switched on is changed while the switch statement is still in progress undefined activity may occur.

Applies To

  • Languages: All that allow for multi-threaded activity
  • Operating platforms: All

Example

Impact

  • Undefined: This flaw will result in the system state going out of sync.

Vulnerabilities

  • Failure to properly lock variables that are used by a switch statement.

Countermeasures

  • Implementation: Variables that may be subject to race conditions should be locked for the duration of any switch statements.

Vulnerability Patterns

How Tos

Personal tools