test(fuzz): a target for reading a backup folder from bytes someone else wrote
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
fd78612dd4
commit
20b2e759e0
10 files changed
+838
-16
No files matched your search
@@ -969,7 +969,7 @@ impl Backups {
|
||||
pub async fn set_up(
|
||||
&self,
|
||||
folder: Option<String>,
|
||||
passphrase: Option<String>,
|
||||
passphrase: Option<zeroize::Zeroizing<String>>,
|
||||
remove_passphrase: bool,
|
||||
) -> Result<Vec<String>, String> {
|
||||
let _one = self.running.lock().await;
|
||||
|
||||
@@ -1658,7 +1658,9 @@ impl Books {
|
||||
} => match self.backups_of(&id) {
|
||||
Ok(backups) => {
|
||||
let rt = tokio::runtime::Handle::current();
|
||||
let pass = passphrase.as_ref().map(|p| p.0.clone());
|
||||
let pass = passphrase
|
||||
.as_ref()
|
||||
.map(|p| zeroize::Zeroizing::new(p.0.clone()));
|
||||
match rt.block_on(backups.set_up(folder, pass, remove_passphrase)) {
|
||||
Ok(lines) => Response::Said { lines },
|
||||
Err(why) => Response::Refused(self.hide(why)),
|
||||
|
||||
Reference in new issue
Block a user