Add length check
This commit is contained in:
parent
6cab39e41d
commit
84b671d585
@ -288,6 +288,9 @@ fn verify_password(password: &str, salted_hash: &str) -> bool {
|
|||||||
return password == salted_hash;
|
return password == salted_hash;
|
||||||
}
|
}
|
||||||
let bytes = bytes.unwrap();
|
let bytes = bytes.unwrap();
|
||||||
|
if bytes.len() < 17 {
|
||||||
|
return password == salted_hash;
|
||||||
|
}
|
||||||
let (salt, hashed_password) = bytes.split_at(16);
|
let (salt, hashed_password) = bytes.split_at(16);
|
||||||
let hashed_password = &hashed_password[0..32];
|
let hashed_password = &hashed_password[0..32];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user