Fix(?) size check in try_from for DHTSchemaSMPL

This commit is contained in:
Teknique 2023-07-24 21:43:14 -07:00
parent 1861650d44
commit f8bb97b39c

View File

@ -96,7 +96,7 @@ impl DHTSchemaSMPL {
impl TryFrom<&[u8]> for DHTSchemaSMPL { impl TryFrom<&[u8]> for DHTSchemaSMPL {
type Error = VeilidAPIError; type Error = VeilidAPIError;
fn try_from(b: &[u8]) -> Result<Self, Self::Error> { fn try_from(b: &[u8]) -> Result<Self, Self::Error> {
if b.len() != Self::FIXED_SIZE { if b.len() < 4 {
apibail_generic!("invalid size"); apibail_generic!("invalid size");
} }
if &b[0..4] != &Self::FCC { if &b[0..4] != &Self::FCC {