mirror of
https://github.com/dynup/kpatch
synced 2025-01-12 16:19:26 +00:00
create-klp-module: check symtab in main()
Make sure symtab section was found before dereferencing it. Found by covscan, see issue #984 for full log. Signed-off-by: Artem Savkov <asavkov@redhat.com>
This commit is contained in:
parent
bba18e3612
commit
5cd9833b0d
@ -486,6 +486,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
/* Rebuild rela sections, new klp rela sections will be rebuilt too. */
|
/* Rebuild rela sections, new klp rela sections will be rebuilt too. */
|
||||||
symtab = find_section_by_name(&kelf->sections, ".symtab");
|
symtab = find_section_by_name(&kelf->sections, ".symtab");
|
||||||
|
if (!symtab)
|
||||||
|
ERROR("missing .symtab section");
|
||||||
|
|
||||||
list_for_each_entry(sec, &kelf->sections, list) {
|
list_for_each_entry(sec, &kelf->sections, list) {
|
||||||
if (!is_rela_section(sec))
|
if (!is_rela_section(sec))
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user