Merge branch 'fix-sha' into 'master'

fix: crypt_sha: bounds-check before slicing setting

See merge request redox-os/relibc!1440
This commit is contained in:
Jeremy Soller
2026-06-08 07:28:16 -06:00
+1 -1
View File
@@ -77,7 +77,7 @@ pub fn crypt_sha(passw: &str, setting: &str, cipher: ShaType) -> Option<String>
let has_round;
// 7 is len("rounds=")
if &setting[cursor..cursor + 7] == RSTRING {
if setting.get(cursor..cursor + 7) == Some(RSTRING) {
cursor += 7;
has_round = true;
if let Some(c_end) = setting[cursor..].chars().position(|r| r == '$') {