Skip to content
Snippets Groups Projects
Commit 929eda3e authored by Dmitry Rodionov's avatar Dmitry Rodionov
Browse files

chore: fix deref of null

Return value of a function 'space_cache_find' is dereferenced at
trigger.c:427 without checking for NULL, but it is usually checked for
this function (32/34).
parent 9c03a087
No related branches found
No related tags found
1 merge request!1060Remaining patches for stat analysis
diff --git a/src/box/sql/trigger.c b/src/box/sql/trigger.c
index 9b5e74320..993c9ae97 100644
--- a/src/box/sql/trigger.c
+++ b/src/box/sql/trigger.c
@@ -422,6 +422,8 @@ struct sql_trigger *
space_trigger_list(uint32_t space_id)
{
struct space *space = space_cache_find(space_id);
+ if (space == NULL) // assert
+ panic("rc == NULL in %s:%d", __FILE__, __LINE__);
assert(space != NULL);
assert(space->def != NULL);
return space->sql_triggers;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment