Objective-C
Objective-C : Incorrect dispatch_once usage
Classification
OWASP Mobile Top 10 2016
Overview
The dispatch_once function is misused. This may lead to incorrect application behavior in a multithreaded environment.
The dispatch_once function is used to ensure that the section of code is executed only once, regardless of the distribution of tasks over threads. This function must accept a static variable (used as a mutex) as an argument (predicate). Otherwise, the execution uniqueness can not be guaranteed.
References
MEDIUM
