mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
commando: fix crash when rune is completely bogus.
The error routine returns a string literal in this case, which we can't take(). Reported-by: @jb55 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
neil saitug
parent
43e5ef3cc4
commit
aaf743e438
@@ -344,10 +344,11 @@ static const char *check_rune(const tal_t *ctx,
|
||||
cinfo.params = params;
|
||||
cinfo.usage = NULL;
|
||||
strmap_init(&cinfo.cached_params);
|
||||
err = rune_test(ctx, master_rune, rune, check_condition, &cinfo);
|
||||
err = rune_test(tmpctx, master_rune, rune, check_condition, &cinfo);
|
||||
/* Just in case they manage to make us speak non-JSON, escape! */
|
||||
if (err)
|
||||
err = json_escape(ctx, take(err))->s;
|
||||
err = json_escape(ctx, err)->s;
|
||||
|
||||
strmap_clear(&cinfo.cached_params);
|
||||
|
||||
/* If it succeeded, *now* we increment any associated usage counter. */
|
||||
|
||||
Reference in New Issue
Block a user