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 <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2019-07-30 14:53:24 +09:30
parent 1ae8b73f0e
commit e23f183468

View File

@@ -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;
}