Merge pull request #970 from wwheart/master

kpatch-elf: fix Segmentation fault when d_type not set properly
This commit is contained in:
Joe Lawrence 2019-06-10 11:17:19 -04:00 committed by GitHub
commit 288568653a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -647,6 +647,7 @@ struct section *create_section_pair(struct kpatch_elf *kelf, char *name,
relasec->data = malloc(sizeof(*relasec->data));
if (!relasec->data)
ERROR("malloc");
relasec->data->d_type = ELF_T_RELA;
/* set section header */
relasec->sh.sh_type = SHT_RELA;