Skip to content

Commit

Permalink
plugins BUGFIX use correct array bound
Browse files Browse the repository at this point in the history
  • Loading branch information
Roytak committed Jan 24, 2025
1 parent c107fd2 commit 9b7711a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/plugins.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ lysc_get_type_plugin(uintptr_t plugin_ref)
return NULL;
}

if (plugin_ref <= ly_plugins_types.count) {
if (plugin_ref <= ly_static_type_plugins_count) {
/* plugin is static, fetch it from the global list */
return &((struct lyplg_type_record *)ly_plugins_types.objs[plugin_ref - 1])->plugin;
} else {
Expand All @@ -159,7 +159,7 @@ lysc_get_ext_plugin(uintptr_t plugin_ref)
return NULL;
}

if (plugin_ref <= ly_plugins_extensions.count) {
if (plugin_ref <= ly_static_ext_plugins_count) {
/* plugin is static, fetch it from the global list */
return &((struct lyplg_ext_record *)ly_plugins_extensions.objs[plugin_ref - 1])->plugin;
} else {
Expand Down

0 comments on commit 9b7711a

Please sign in to comment.