Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated SetSearchKey function to handle null search #974

Merged
merged 4 commits into from
Sep 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/Cafe/OS/libs/nn_olv/nn_olv_PostTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,11 @@ namespace nn
// SetSearchKey__Q3_2nn3olv25DownloadPostDataListParamFPCwUc
static nnResult SetSearchKey(DownloadPostDataListParam* _this, const uint16be* searchKey, uint8 searchKeyIndex)
{
if( !searchKey )
{
memset(&_this->searchKeyArray[searchKeyIndex], 0, sizeof(SearchKey));
return OLV_RESULT_SUCCESS;
}
if (searchKeyIndex >= MAX_NUM_SEARCH_KEY)
return OLV_RESULT_INVALID_PARAMETER;
memset(&_this->searchKeyArray[searchKeyIndex], 0, sizeof(SearchKey));
Expand All @@ -546,6 +551,11 @@ namespace nn
// SetSearchKey__Q3_2nn3olv25DownloadPostDataListParamFPCw
static nnResult SetSearchKeySingle(DownloadPostDataListParam* _this, const uint16be* searchKey)
{
if (searchKey == nullptr)
{
cemuLog_logDebug(LogType::NN_OLV, "DownloadPostDataListParam::SetSearchKeySingle: searchKeySingle is Null\n");
return OLV_RESULT_INVALID_PARAMETER;
}
return SetSearchKey(_this, searchKey, 0);
}

Expand Down