Fix(?) size check in try_from for DHTSchemaSMPL
This commit is contained in:
parent
1861650d44
commit
f8bb97b39c
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user