fn sanetize_destination_path(dest: &Path) -> Result<&Path> {
    dest.components()
        .find(|c| c == &Component::ParentDir)
        .map_or(Ok(dest), |_| {
            Err(std::io::Error::new(
                std::io::ErrorKind::InvalidData,
                "cannot use relative destination directory",
            )
            .into())
        })
}
// This ensures we're not affected by the zip-slip vulnerability. In summary, it
// uses relative destination paths to unpack files in unexpected places.
//
// More details can be found at: http://snyk.io/research/zip-slip-vulnerability
This ensures we're not affected by the zip-slip vulnerability. In summary, it
uses relative destination paths to unpack files in unexpected places.


This ensures we ' re not affected by the zip - slip vulnerability . In summary it uses relative destination paths to unpack files in unexpected places .
fn sanetize_destination_path(dest: &Path) -> Result<&Path> {
    dest.components()
        .find(|c| c == &Component::ParentDir)
        .map_or(Ok(dest), |_| {
            Err(std::io::Error::new(
                std::io::ErrorKind::InvalidData,
                "cannot use relative destination directory",
            )
            .into())
        })
}
fn sanetize_destination_path ( dest : & Path ) -> Result < & Path > { dest . components ( ) . find ( | c | c == & Component :: ParentDir ) . map_or ( Ok ( dest ) , | _ | { Err ( std :: io :: Error :: new ( std :: io :: ErrorKind :: InvalidData , " " , ) . into ( ) ) } ) }
This ensures we're not affected by the zip-slip vulnerability.
This ensures we ' re not affected by the zip - slip vulnerability .
dest
&Path
dest
&Path