data.function needs to be set for the return value to be of any use and
strcmp won't work with NULL pointer either. (CID 99907)
Signed-off-by: Jouni Malinen <j@w1.fi>
data.found = FALSE;
bfd_map_over_sections(abfd, find_addr_sect, &data);
- while (data.found || !data.function) {
- if (pos > 0 ||
- os_strcmp(data.function, __func__) != 0) {
+ while (data.found) {
+ if (data.function &&
+ (pos > 0 ||
+ os_strcmp(data.function, __func__) != 0)) {
buf[pos++] = data.function;
if (pos == len)
return pos;