In profile_iterator(), return PROF_MAGIC_ITERATOR if *iter_p is NULL,
instead of dereferencing a null pointer, as we did prior to 1.10.
Correct calling code will not trigger this case, but incorrect code
has been reported in the field.
(cherry picked from commit
9a343200d305e7c8df6e556d63afaee42194175f)
ticket: 8127 (new)
version_fixed: 1.12.3
status: resolved
*ret_name = NULL;
if (ret_value)
*ret_value = NULL;
- if (iter->magic != PROF_MAGIC_ITERATOR)
+ if (iter == NULL || iter->magic != PROF_MAGIC_ITERATOR)
return PROF_MAGIC_ITERATOR;
profile = iter->profile;