Commit 8e037cc
authored
Rollup merge of rust-lang#125060 - ChrisJefferson:pathbuf-doc, r=workingjubilee
Expand documentation of PathBuf, discussing lack of sanitization
Various methods in `PathBuf`, in particular `set_file_name` and `set_extension` accept strings which include path seperators (like `../../etc`). These methods just glue together strings, so you can end up with strange strings.
This isn't reasonable to change/fix at this point, and might not even be fixable, but I think should be documented. In particular, you probably shouldn't blindly build paths using strings given by possibly malicious users.1 file changed
+24
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1153 | 1153 | | |
1154 | 1154 | | |
1155 | 1155 | | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
1156 | 1171 | | |
1157 | 1172 | | |
1158 | 1173 | | |
| |||
1391 | 1406 | | |
1392 | 1407 | | |
1393 | 1408 | | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
1394 | 1412 | | |
1395 | 1413 | | |
1396 | 1414 | | |
| |||
1411 | 1429 | | |
1412 | 1430 | | |
1413 | 1431 | | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
1414 | 1438 | | |
1415 | 1439 | | |
1416 | 1440 | | |
| |||
0 commit comments