mirror of https://github.com/cemu-project/Cemu.git
nn_olv: Handle nullptr key in SetSearchKey (#974)
This commit is contained in:
parent
b4aa10bee4
commit
638c4014a1
|
@ -531,6 +531,11 @@ namespace nn
|
||||||
// SetSearchKey__Q3_2nn3olv25DownloadPostDataListParamFPCwUc
|
// SetSearchKey__Q3_2nn3olv25DownloadPostDataListParamFPCwUc
|
||||||
static nnResult SetSearchKey(DownloadPostDataListParam* _this, const uint16be* searchKey, uint8 searchKeyIndex)
|
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)
|
if (searchKeyIndex >= MAX_NUM_SEARCH_KEY)
|
||||||
return OLV_RESULT_INVALID_PARAMETER;
|
return OLV_RESULT_INVALID_PARAMETER;
|
||||||
memset(&_this->searchKeyArray[searchKeyIndex], 0, sizeof(SearchKey));
|
memset(&_this->searchKeyArray[searchKeyIndex], 0, sizeof(SearchKey));
|
||||||
|
@ -546,6 +551,11 @@ namespace nn
|
||||||
// SetSearchKey__Q3_2nn3olv25DownloadPostDataListParamFPCw
|
// SetSearchKey__Q3_2nn3olv25DownloadPostDataListParamFPCw
|
||||||
static nnResult SetSearchKeySingle(DownloadPostDataListParam* _this, const uint16be* searchKey)
|
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);
|
return SetSearchKey(_this, searchKey, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue