XGameSave: reject empty container name in XGameSaveDeleteContainer #94
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/95"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-23T11:07:24Z.
Summary
Fixes a data-loss bug in
XGameSaveDeleteContainer/XGameSaveDeleteContainerAsync(crates/xcl/src/hle/xgameruntime/gamesave.rs):XGameSaveCreateContainer,XGameSaveDeleteContainerdid not validate that the container name is non-empty (or within the 256-byte limit).""causedenc("") == "", sostd::fs::remove_dir_all(pr.root.join(""))deleted the entire provider root directory and wiped every save container under it while returningS_OK.XGameSaveDeleteContainernow rejectsn.is_empty() || n.len() > 256withE_GS_INVALID_CONTAINER_NAME, matchingXGameSaveCreateContainer.Testing
delete_container_rejects_empty_name_without_wiping_provider_rootincrates/xcl/src/hle/xgameruntime/gamesave.rs:origin/main):XGameSaveDeleteContainer(provider, "")returnedS_OKand deleted existing containers and the provider root directory.E_GS_INVALID_CONTAINER_NAMEfor both syncXGameSaveDeleteContainerand asyncXGameSaveDeleteContainerAsync, leaving existing containers and blobs intact.origin/main(60599a9):cargo build --workspaceandcargo test --workspace -- --test-threads=4pass with 0 failures and 0 new warnings.Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-23T11:22:04Z.
Closing in favor of #108, which supersedes this fix — it includes the same
!name.is_empty() && name.len() <= 256(E_GS_INVALID_CONTAINER_NAME) validation for bothXGameSaveDeleteContainerandXGameSaveDeleteContainerAsync, plus defers async container deletion until work dispatch and serializes deletion withapply().Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T11:25:40Z.
Merged together with #95–#102 and checked on Windows 11 with an RX 9070:
cargo test --workspacegreen with the retail samples (shader pack, console DLLs, texture archive), lib tests also withXCL_SPLIT_WAVE64=1; XDefiant (title screen, a scripted A reaches its "Xbox network unavailable" dialog), Unicorn Overlord and Minecraft run. Thanks!upstream-sync referenced this pull request2026-11-25 03:05:50 +00:00
Pull request closed