create-diff-object: make sure sym->sec is not null in kpatch_replace_sections_syms()

Check that sym->sec is not null before dereferencing it.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
This commit is contained in:
Artem Savkov 2019-08-01 11:54:01 +02:00
parent 9049abd0f5
commit 1722f14221

View File

@ -1322,6 +1322,7 @@ static void kpatch_replace_sections_syms(struct kpatch_elf *kelf)
int start, end;
if (sym->type == STT_SECTION ||
!sym->sec ||
sym->sec != rela->sym->sec)
continue;