Skip to content

Commit 77c867d

Browse files
rustyrussellcdecker
authored andcommitted
common: fix bolt11 parsing of unknown f versions.
As tested in next test. Signed-off-by: Rusty Russell <[email protected]>
1 parent d8e933a commit 77c867d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

common/bolt11.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,9 +390,14 @@ static char *decode_f(struct bolt11 *b11,
390390
fallback = scriptpubkey_witness_raw(b11, version,
391391
f, tal_count(f));
392392
tal_free(f);
393-
} else
393+
} else {
394+
/* Restore version for unknown field! */
395+
(*data)--;
396+
(*data_len)++;
397+
data_length++;
394398
return unknown_field(b11, hu5, data, data_len, 'f',
395399
data_length);
400+
}
396401

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

0 commit comments

Comments
 (0)