sceSaveDataDialogOpen passed a SaveDataDirName to snprintf as a C string.
A name that fills all 32 bytes without a NUL made snprintf read past the
field. Check for a NUL with memchr, as sceSaveDataBackup does, and return
SAVE_DATA_DIALOG_ERROR_ARG_NULL when there is none.
sceSaveDataDialogOpen read every SaveDataDirName of the guest dir_names
array in place, so an unreadable array entry faulted the host. Copy each
entry in with GuestCopyIn and return SAVE_DATA_DIALOG_ERROR_ARG_NULL when
an entry cannot be read.
sceSaveDataDialogOpen dereferenced the guest SaveDataDialogItems directly,
so an unreadable items pointer faulted the host. Copy the structure in with
GuestCopyIn and return SAVE_DATA_DIALOG_ERROR_ARG_NULL when it cannot be
read. The dialog state is now written only after every read has succeeded,
so a rejected open keeps the result of the previous dialog.
sceSaveDataDialogOpen dereferenced the guest SaveDataDialogParam directly,
so an unreadable parameter faulted the host. Copy the structure in with
GuestCopyIn and return SAVE_DATA_DIALOG_ERROR_ARG_NULL when it cannot be
read, the error the same file already uses for unwritable result pointers.
When sceSaveDataDialogGetResult is passed a non-null dir_name pointer but no directory name was selected by the dialog, write the empty string into dir_name so the caller's output buffer is properly null-terminated instead of retaining uninitialized bytes.
Opening a save progress dialog immediately reported FINISHED. Skyrim
waited for RUNNING before writing SAVEDATA.DAT and never resumed. Keep
progress-bar mode running through polling and progress updates until
Close, retaining the existing automatic responses for other dialog modes.
Add lifecycle regression coverage for repeated polling, completion,
reopening, result metadata and ordinary selection dialogs. The test
failed on the previous implementation and passes with the fix on Fedora
44 Release. Correcting the live dialog state recovered a blocked Skyrim
save without restarting its session.
Written with AI assistance.