check that strcat would not overflow static size buffer

This commit is contained in:
Islamov A 2020-06-14 18:28:43 +05:00 committed by kirill reshke
parent 5a31565901
commit 1cab69f930
1 changed files with 4 additions and 0 deletions

View File

@ -44,6 +44,10 @@ od_target_module_add(od_logger_t *logger,
goto error_close_handle;
}
if (strlen(module_ptr->path) + strlen(target_module_path) + 1 >
sizeof(module_ptr->path))
goto error_close_handle;
module_ptr->handle = handle;
od_list_init(&module_ptr->link);
od_list_append(&modules->link, &module_ptr->link);