Skip to content

Commit 586759f

Browse files
aibaarsgeoffw0
andauthored
Apply suggestions from code review
Co-authored-by: Geoffrey White <[email protected]>
1 parent 5f61c21 commit 586759f

File tree

1 file changed

+2
-2
lines changed
  • rust/ql/test/query-tests/security/CWE-022/src

1 file changed

+2
-2
lines changed

rust/ql/test/query-tests/security/CWE-022/src/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use poem::{error::InternalServerError, handler, http::StatusCode, web::Query, Error, Result};
2-
use std::{env::home_dir, fs, path::PathBuf};
2+
use std::{fs, path::PathBuf};
33

44
//#[handler]
55
fn tainted_path_handler_bad(
@@ -52,7 +52,7 @@ fn tainted_path_handler_folder_almost_good2(
5252
let public_path = PathBuf::from("/var/www/public_html");
5353
let file_path = public_path.join(PathBuf::from(file_path));
5454
let file_path = file_path.canonicalize().unwrap();
55-
// BAD: thecheck to ensure that the path stays within the public folder is wrong
55+
// BAD: the check to ensure that the path stays within the public folder is wrong
5656
if file_path.starts_with(public_path) {
5757
return Err(Error::from_status(StatusCode::BAD_REQUEST));
5858
}

0 commit comments

Comments
 (0)