We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9abe4bb commit aeaed62Copy full SHA for aeaed62
lightning/src/util/persist.rs
@@ -216,6 +216,12 @@ where
216
for stored_key in kv_store.list(
217
CHANNEL_MONITOR_PERSISTENCE_NAMESPACE, CHANNEL_MONITOR_PERSISTENCE_SUB_NAMESPACE)?
218
{
219
+ if stored_key.len() < 66 {
220
+ return Err(io::Error::new(
221
+ io::ErrorKind::InvalidData,
222
+ "Stored key has invalid length"));
223
+ }
224
+
225
let txid = Txid::from_hex(stored_key.split_at(64).0).map_err(|_| {
226
io::Error::new(io::ErrorKind::InvalidData, "Invalid tx ID in stored key")
227
})?;
0 commit comments