]> git.bitcoin.ninja Git - rust-lightning/commit
Fix crash due to index-out-of-bounds in feature translation
authorValentine Wallace <vwallace@protonmail.com>
Wed, 14 Jul 2021 20:23:38 +0000 (16:23 -0400)
committerValentine Wallace <vwallace@protonmail.com>
Wed, 14 Jul 2021 22:55:17 +0000 (18:55 -0400)
commit7497ed2402aaf8b69b6d5c1a85dc99dba36a6ca3
treefd23fbba685a560e15ba27f0db6f951da29d2112
parentafae12ea1e610634f90335443e3fe9f126bf5551
Fix crash due to index-out-of-bounds in feature translation

This was reported by a user when trying to send a payment using the LDK
sample (specifically during route generation when translating a Features
from one context to another)

The problem was we didn't check T::KNOWN_FEATURE_MASK vec length before
indexing into it, due likely to the assumption that known feature vec
lengths are the same across contexts, when they may not be
lightning/src/ln/features.rs