[OpenMP] libomp: Fix possible NULL dereferences
authorAndreyChurbanov <andrey.churbanov@intel.com>
Mon, 7 Dec 2020 16:09:07 +0000 (19:09 +0300)
committerAndreyChurbanov <andrey.churbanov@intel.com>
Mon, 7 Dec 2020 16:09:07 +0000 (19:09 +0300)
commit22558c8501eaf5e7547ee13fa5a009efdec6dc90
tree7936cf4ae94799eaeb9e2bdcafdc5a3b3ce23a87
parente6bc4a71e3450d7230205683f63d6e22fbf9bf05
[OpenMP] libomp: Fix possible NULL dereferences

Check pointer returned by strchr, as it can be NULL in case of broken
format of input string. Introduced new function __kmp_str_loc_numbers
for fast parsing of numbers only in the location string.
Also made some cleanup of __kmp_str_loc_init declaration and usage:
- changed type of init_fname parameter to bool;
- changed input from true to false in places where fname is not used.

Differential Revision: https://reviews.llvm.org/D90962
openmp/runtime/src/kmp_debugger.cpp
openmp/runtime/src/kmp_itt.inl
openmp/runtime/src/kmp_lock.cpp
openmp/runtime/src/kmp_str.cpp
openmp/runtime/src/kmp_str.h