• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 Huawei Device Co., Ltd.
3  * SPDX-License-Identifier: GPL-2.0
4  *
5  * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT.
6  * Do not use in new code.
7  *
8  * Unless required by applicable law or agreed to in writing, software
9  * distributed under the License is distributed on an "AS IS" BASIS,
10  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11  * See the License for the specific language governing permissions and
12  * limitations under the License.
13  */
14 
15 #include <vector>
16 #include <cstddef>
17 #include <cstdint>
18 #include "__config"
19 #include "accesstokenidcommon.h"
20 
21 using namespace std;
22 using namespace OHOS::Kernel::AccessToken;
23 namespace OHOS {
AccessfTokenidThreadTestFuzzTest(const uint8_t * data,size_t size)24 bool AccessfTokenidThreadTestFuzzTest(const uint8_t *data, size_t size)
25 {
26     bool ret = false;
27     if ((data == nullptr) || (size < sizeof(unsigned long long))) {
28         return ret;
29     } else {
30         uint8_t *dataFtoken = const_cast<uint8_t *>(data);
31         ret = AccessfTokenidThreadTest(dataFtoken);
32     }
33     return ret;
34 }
35 }
36 
LLVMFuzzerTestOneInput(const uint8_t * data,size_t size)37 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
38 {
39     OHOS::AccessfTokenidThreadTestFuzzTest(data, size);
40     return 0;
41 }
42