From 77c867d95fc673499de58413cefdf9cd28677c80 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 3 Feb 2020 10:59:42 +1030 Subject: [PATCH] common: fix bolt11 parsing of unknown `f` versions. As tested in next test. Signed-off-by: Rusty Russell --- common/bolt11.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/bolt11.c b/common/bolt11.c index 81483ff9f..d0c84315c 100644 --- a/common/bolt11.c +++ b/common/bolt11.c @@ -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);