lightningd: don't call memcpy with NULL.

Thanks C committee!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2023-01-12 11:43:14 +10:30
parent 5dfcd15782
commit 6044184323

View File

@ -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;
}