From e23f183468f693ddd6759331a27a21e6ea17d69f Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 30 Jul 2019 14:53:24 +0930 Subject: [PATCH] common/sphinx: use bigsize_get not varint_get. These are not the same if it's more than one byte. Testing would have caught this, I assume. Signed-off-by: Rusty Russell --- common/sphinx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/sphinx.c b/common/sphinx.c index 2ca43cebe..913c0650e 100644 --- a/common/sphinx.c +++ b/common/sphinx.c @@ -486,7 +486,7 @@ static void sphinx_parse_payload(struct route_step *step, const u8 *src) hop_size = FRAME_SIZE; step->type = SPHINX_V0_PAYLOAD; } else { - vsize = varint_get(src, 3, &raw_size); + vsize = bigsize_get(src, 3, &raw_size); hop_size = raw_size + vsize + HMAC_SIZE; step->type = SPHINX_TLV_PAYLOAD; }