mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-22 07:17:53 -05:00
reporter: Eliminate undefined behavior in SaveErrorReport
The optionals are unconditionally dereferenced when setting the custom error text, and in a few cases this function is called using the default value of the optionals. This means we'd be dereferencing uninitialized storage. Since they're used unconditionally, we can use value_or to set a default when storage is uninitialized.
This commit is contained in:
@ -61,8 +61,8 @@ public:
|
||||
|
||||
// Used by error applet
|
||||
void SaveErrorReport(u64 title_id, Result result,
|
||||
std::optional<std::string> custom_text_main = {},
|
||||
std::optional<std::string> custom_text_detail = {}) const;
|
||||
const std::optional<std::string>& custom_text_main = {},
|
||||
const std::optional<std::string>& custom_text_detail = {}) const;
|
||||
|
||||
void SaveFSAccessLog(std::string_view log_message) const;
|
||||
|
||||
|
Reference in New Issue
Block a user