diff --git a/src/intercept.h b/src/intercept.h index a8145723..67130dfc 100644 --- a/src/intercept.h +++ b/src/intercept.h @@ -117,6 +117,15 @@ struct patch_desc { void patch_apply(struct patch_desc *patch); +/* + * A section_list struct contains information about sections where + * libsyscall_intercept looks for jump destinations among symbol addresses. + * Generally, only two sections are used for this, so 16 should be enough + * for the maximum number of headers to be stored. + * + * See the calls to the add_table_info routine in the intercept_desc.c source + * file. + */ struct section_list { Elf64_Half count; Elf64_Shdr headers[0x10]; diff --git a/src/intercept_desc.c b/src/intercept_desc.c index be059ca6..9823ca6d 100644 --- a/src/intercept_desc.c +++ b/src/intercept_desc.c @@ -81,6 +81,8 @@ add_table_info(struct section_list *list, const Elf64_Shdr *header) if (list->count < max) { list->headers[list->count] = *header; list->count++; + } else { + xabort("allocated section_list exhausted"); } }