Skip to content

Commit

Permalink
lightningd: don't call memcpy with NULL.
Browse files Browse the repository at this point in the history
Thanks C committee!

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Jan 12, 2023
1 parent 5dfcd15 commit 6044184
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lightningd/plugin_hook.c
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,8 @@ static struct plugin **plugin_hook_make_ordered(const tal_t *ctx,
}

/* Success! Copy ordered hooks back. */
memcpy(hook->hooks, done, tal_bytelen(hook->hooks));
if (hook->hooks)
memcpy(hook->hooks, done, tal_bytelen(hook->hooks));
return NULL;
}

Expand Down

0 comments on commit 6044184

Please sign in to comment.