Skip to content

Commit

Permalink
common: fix bolt11 parsing of unknown f versions.
Browse files Browse the repository at this point in the history
As tested in next test.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell authored and cdecker committed Feb 5, 2020
1 parent d8e933a commit 77c867d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion common/bolt11.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,14 @@ static char *decode_f(struct bolt11 *b11,
fallback = scriptpubkey_witness_raw(b11, version,
f, tal_count(f));
tal_free(f);
} else
} else {
/* Restore version for unknown field! */
(*data)--;
(*data_len)++;
data_length++;
return unknown_field(b11, hu5, data, data_len, 'f',
data_length);
}

if (b11->fallbacks == NULL)
b11->fallbacks = tal_arr(b11, const u8 *, 1);
Expand Down

0 comments on commit 77c867d

Please sign in to comment.