diff --git a/interfaces/inner_api/file_access/src/file_access_ext_stub.cpp b/interfaces/inner_api/file_access/src/file_access_ext_stub.cpp index 23620687f053d0b99435ef1f47562de8ddcc5579..ec8c917c45de1e58e77df7a20c7dedd376782aea 100644 --- a/interfaces/inner_api/file_access/src/file_access_ext_stub.cpp +++ b/interfaces/inner_api/file_access/src/file_access_ext_stub.cpp @@ -567,6 +567,11 @@ ErrCode FileAccessExtStub::CmdQuery(MessageParcel &data, MessageParcel &reply) FinishTrace(HITRACE_TAG_FILEMANAGEMENT); return E_IPCS; } + if (count > FILE_RESULT_TYPE.size()){ + HILOG_ERROR(" The number of query operations exceeds %{public}d ",FILE_RESULT_TYPE.size()); + FinishTrace(HITRACE_TAG_FILEMANAGEMENT); + return E_IPCS; + } std::vector columns; for (int64_t i = 0; i < count; i++) { columns.push_back(data.ReadString());