• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #include "relationalstorecapi_fuzzer.h"
16 
17 #include <fuzzer/FuzzedDataProvider.h>
18 
19 #include <cstdlib>
20 
21 #include "grd_api_manager.h"
22 #include "rdb_errno.h"
23 #include "relational_store.h"
24 #include "relational_store_error_code.h"
25 #include "relational_store_impl.h"
26 
27 using namespace OHOS::NativeRdb;
28 using namespace OHOS::RdbNdk;
29 
30 // Helper function to create an OH_Rdb_Config structure with random data
CreateRandomConfig(FuzzedDataProvider & provider)31 OH_Rdb_Config *CreateRandomConfig(FuzzedDataProvider &provider)
32 {
33     OH_Rdb_Config *config = new OH_Rdb_Config();
34     config->selfSize = sizeof(OH_Rdb_Config);
35     config->dataBaseDir = strdup(provider.ConsumeRandomLengthString().c_str());
36     config->storeName = strdup(provider.ConsumeRandomLengthString().c_str());
37     config->bundleName = strdup(provider.ConsumeRandomLengthString().c_str());
38     config->moduleName = strdup(provider.ConsumeRandomLengthString().c_str());
39     config->isEncrypt = provider.ConsumeBool();
40     config->securityLevel = provider.ConsumeIntegralInRange<int>(S1, S4);
41     config->area = provider.ConsumeIntegralInRange<int>(RDB_SECURITY_AREA_EL1, RDB_SECURITY_AREA_EL5);
42     return config;
43 }
44 
ReleaseConfig(OH_Rdb_Config * config)45 void ReleaseConfig(OH_Rdb_Config *config)
46 {
47     if (config == nullptr) {
48         return;
49     }
50     if (config->dataBaseDir != nullptr) {
51         free(static_cast<void *>(const_cast<char *>(config->dataBaseDir)));
52     }
53     if (config->storeName != nullptr) {
54         free(static_cast<void *>(const_cast<char *>(config->storeName)));
55     }
56     if (config->bundleName != nullptr) {
57         free(static_cast<void *>(const_cast<char *>(config->bundleName)));
58     }
59     if (config->moduleName != nullptr) {
60         free(static_cast<void *>(const_cast<char *>(config->moduleName)));
61     }
62     delete config;
63     config = nullptr;
64 }
65 
66 // Helper function to create an OH_Rdb_ConfigV2 structure with random data
CreateRandomConfigV2(FuzzedDataProvider & provider)67 OH_Rdb_ConfigV2 *CreateRandomConfigV2(FuzzedDataProvider &provider)
68 {
69     OH_Rdb_ConfigV2 *configV2 = OH_Rdb_CreateConfig();
70     std::string databaseDir = provider.ConsumeRandomLengthString();
71     OH_Rdb_SetDatabaseDir(configV2, databaseDir.c_str());
72     std::string storeName = provider.ConsumeRandomLengthString();
73     OH_Rdb_SetStoreName(configV2, storeName.c_str());
74     std::string bundleName = provider.ConsumeRandomLengthString();
75     OH_Rdb_SetBundleName(configV2, bundleName.c_str());
76     std::string bmoduleName = provider.ConsumeRandomLengthString();
77     OH_Rdb_SetModuleName(configV2, bmoduleName.c_str());
78     bool isEncrypted = provider.ConsumeBool();
79     OH_Rdb_SetEncrypted(configV2, isEncrypted);
80     int securityLevel = provider.ConsumeIntegral<int>();
81     OH_Rdb_SetSecurityLevel(configV2, securityLevel);
82     int area = provider.ConsumeIntegral<int>();
83     OH_Rdb_SetArea(configV2, area);
84     int dbType = provider.ConsumeIntegral<int>();
85     OH_Rdb_SetDbType(configV2, dbType);
86 
87     Rdb_Tokenizer tokenizer =
88         static_cast<Rdb_Tokenizer>(provider.ConsumeIntegralInRange<int>(RDB_NONE_TOKENIZER, RDB_CUSTOM_TOKENIZER));
89     bool isSupported = false;
90     OH_Rdb_IsTokenizerSupported(tokenizer, &isSupported);
91     {
92         Rdb_Tokenizer tokenizer =
93             static_cast<Rdb_Tokenizer>(provider.ConsumeIntegralInRange<int>(RDB_NONE_TOKENIZER, RDB_CUSTOM_TOKENIZER));
94         OH_Rdb_SetTokenizer(configV2, tokenizer);
95     }
96     bool isPersistent = provider.ConsumeBool();
97     OH_Rdb_SetPersistent(configV2, isPersistent);
98     return configV2;
99 }
100 
101 // Helper function to create an OH_Predicates structure with random data
CreateRandomPredicates(FuzzedDataProvider & provider)102 OH_Predicates *CreateRandomPredicates(FuzzedDataProvider &provider)
103 {
104     std::string table = provider.ConsumeRandomLengthString();
105     OH_Predicates *predicates = OH_Rdb_CreatePredicates(table.c_str());
106     if (predicates == nullptr) {
107         return nullptr;
108     }
109 
110     OH_VObject *valueObject = OH_Rdb_CreateValueObject();
111     {
112         std::string value = provider.ConsumeRandomLengthString();
113         valueObject->putText(valueObject, value.c_str());
114     }
115 
116     {
117         std::string value = provider.ConsumeRandomLengthString();
118         predicates->equalTo(predicates, value.c_str(), valueObject);
119     }
120 
121     return predicates;
122 }
123 
124 // Helper function to create an OH_VBucket structure with random data
CreateRandomVBucket(FuzzedDataProvider & provider)125 OH_VBucket *CreateRandomVBucket(FuzzedDataProvider &provider)
126 {
127     OH_VBucket *vBucket = OH_Rdb_CreateValuesBucket();
128     if (vBucket == nullptr) {
129         return nullptr;
130     }
131     const int minLen = 1;
132     const int maxLen = 50;
133     size_t len = provider.ConsumeIntegralInRange<size_t>(minLen, maxLen);
134     for (size_t i = 0; i < len; i++) {
135         std::string column = provider.ConsumeRandomLengthString();
136         int64_t value = provider.ConsumeIntegral<int64_t>();
137         vBucket->putInt64(vBucket, column.c_str(), value);
138     }
139     return vBucket;
140 }
141 
142 // Helper function to create an OH_Rdb_TransOptions structure with random data
CreateRandomTransOptions(FuzzedDataProvider & provider)143 OH_RDB_TransOptions *CreateRandomTransOptions(FuzzedDataProvider &provider)
144 {
145     OH_RDB_TransOptions *options = OH_RdbTrans_CreateOptions();
146     OH_RDB_TransType type =
147         static_cast<OH_RDB_TransType>(provider.ConsumeIntegralInRange<int>(RDB_TRANS_DEFERRED, RDB_TRANS_BUTT));
148     OH_RdbTransOption_SetType(options, type);
149     return options;
150 }
151 
OHRdbCreateOrOpenFuzzTest(FuzzedDataProvider & provider)152 void OHRdbCreateOrOpenFuzzTest(FuzzedDataProvider &provider)
153 {
154     OH_Rdb_Config *config = CreateRandomConfig(provider);
155     int errCode;
156     OH_Rdb_Store *store = OH_Rdb_GetOrOpen(config, &errCode);
157     if (store != nullptr) {
158         // Test OH_Rdb_CloseStore
159         OH_Rdb_CloseStore(store);
160     }
161     ReleaseConfig(config);
162 }
163 
OHRdbCreateOrOpenV2FuzzTest(FuzzedDataProvider & provider)164 void OHRdbCreateOrOpenV2FuzzTest(FuzzedDataProvider &provider)
165 {
166     OH_Rdb_ConfigV2 *config = CreateRandomConfigV2(provider);
167     int errCode;
168     OH_Rdb_Store *store = OH_Rdb_CreateOrOpen(config, &errCode);
169     if (store != nullptr) {
170         // Test OH_Rdb_CloseStore
171         OH_Rdb_CloseStore(store);
172     }
173 }
174 
OHRdbSetVersionFuzzTest(FuzzedDataProvider & provider)175 void OHRdbSetVersionFuzzTest(FuzzedDataProvider &provider)
176 {
177     OH_Rdb_Config *config = CreateRandomConfig(provider);
178     int errCode;
179     OH_Rdb_Store *store = OH_Rdb_GetOrOpen(config, &errCode);
180     if (store != nullptr) {
181         int version = provider.ConsumeIntegral<int>();
182         OH_Rdb_SetVersion(store, version);
183         OH_Rdb_CloseStore(store);
184     }
185     ReleaseConfig(config);
186 }
187 
OHRdbQueryLockedRowFuzzTest(FuzzedDataProvider & provider)188 void OHRdbQueryLockedRowFuzzTest(FuzzedDataProvider &provider)
189 {
190     OH_Rdb_Config *config = CreateRandomConfig(provider);
191     int errCode;
192     OH_Rdb_Store *store = OH_Rdb_GetOrOpen(config, &errCode);
193     if (store != nullptr) {
194         OH_Predicates *predicates = CreateRandomPredicates(provider);
195         if (predicates != nullptr) {
196             const int minColumnCount = 1;
197             const int maxColumnCount = 50;
198             size_t columnCount = provider.ConsumeIntegralInRange<size_t>(minColumnCount, maxColumnCount);
199             const char **columnNames = new const char *[columnCount];
200             std::vector<std::unique_ptr<char[]>> columnStorage(columnCount);
201 
202             for (size_t i = 0; i < columnCount; ++i) {
203                 std::string columnName = provider.ConsumeRandomLengthString();
204                 columnStorage[i] = std::make_unique<char[]>(columnName.size() + 1);
205                 std::copy(columnName.begin(), columnName.end(), columnStorage[i].get());
206                 columnStorage[i][columnName.size()] = '\0';
207                 columnNames[i] = columnStorage[i].get();
208             }
209             OH_Cursor *cursor = OH_Rdb_QueryLockedRow(store, predicates, columnNames, columnCount);
210             if (cursor != nullptr) {
211                 cursor->destroy(cursor);
212             }
213             predicates->destroy(predicates);
214             delete[] columnNames;
215         }
216         OH_Rdb_CloseStore(store);
217     }
218     ReleaseConfig(config);
219 }
220 
OHRdbUnlockRowFuzzTest(FuzzedDataProvider & provider)221 void OHRdbUnlockRowFuzzTest(FuzzedDataProvider &provider)
222 {
223     OH_Rdb_Config *config = CreateRandomConfig(provider);
224     int errCode;
225     OH_Rdb_Store *store = OH_Rdb_GetOrOpen(config, &errCode);
226     if (store != nullptr) {
227         OH_Predicates *predicates = CreateRandomPredicates(provider);
228         if (predicates != nullptr) {
229             OH_Rdb_UnlockRow(store, predicates);
230             predicates->destroy(predicates);
231         }
232         OH_Rdb_CloseStore(store);
233     }
234     ReleaseConfig(config);
235 }
236 
OHRdbExecuteQueryV2FuzzTest(FuzzedDataProvider & provider)237 void OHRdbExecuteQueryV2FuzzTest(FuzzedDataProvider &provider)
238 {
239     OH_Rdb_Config *config = CreateRandomConfig(provider);
240     int errCode;
241     OH_Rdb_Store *store = OH_Rdb_GetOrOpen(config, &errCode);
242     if (store != nullptr) {
243         std::string sql = provider.ConsumeRandomLengthString();
244         OH_Data_Values *args = nullptr; // Simplified for fuzzing
245         OH_Cursor *cursor = OH_Rdb_ExecuteQueryV2(store, sql.c_str(), args);
246         if (cursor != nullptr) {
247             cursor->destroy(cursor);
248         }
249         OH_Rdb_CloseStore(store);
250     }
251     ReleaseConfig(config);
252 }
253 
OHRdbBatchInsertFuzzTest(FuzzedDataProvider & provider)254 void OHRdbBatchInsertFuzzTest(FuzzedDataProvider &provider)
255 {
256     OH_Rdb_Config *config = CreateRandomConfig(provider);
257     int errCode;
258     OH_Rdb_Store *store = OH_Rdb_GetOrOpen(config, &errCode);
259     if (store != nullptr) {
260         std::string table = provider.ConsumeRandomLengthString();
261         const int minRowCount = 1;
262         const int maxRowCount = 5;
263         size_t rowCount = provider.ConsumeIntegralInRange<size_t>(minRowCount, maxRowCount);
264         OH_Data_VBuckets *list = OH_VBuckets_Create();
265         for (size_t i = 0; i < rowCount; i++) {
266             OH_VBuckets_PutRow(list, CreateRandomVBucket(provider));
267         }
268         int64_t changes;
269         Rdb_ConflictResolution resolution = static_cast<Rdb_ConflictResolution>(
270             provider.ConsumeIntegralInRange<int>(RDB_CONFLICT_NONE, RDB_CONFLICT_REPLACE));
271         OH_Rdb_BatchInsert(store, table.c_str(), list, resolution, &changes);
272         OH_VBuckets_Destroy(list);
273         OH_Rdb_CloseStore(store);
274     }
275     ReleaseConfig(config);
276 }
277 
OHRdbUpdateFuzzTest(FuzzedDataProvider & provider)278 void OHRdbUpdateFuzzTest(FuzzedDataProvider &provider)
279 {
280     OH_Rdb_Config *config = CreateRandomConfig(provider);
281     int errCode;
282     OH_Rdb_Store *store = OH_Rdb_GetOrOpen(config, &errCode);
283     if (store != nullptr) {
284         OH_VBucket *valuesBucket = CreateRandomVBucket(provider);
285         OH_Predicates *predicates = CreateRandomPredicates(provider);
286         if (valuesBucket != nullptr && predicates != nullptr) {
287             OH_Rdb_Update(store, valuesBucket, predicates);
288             predicates->destroy(predicates);
289         }
290         OH_Rdb_CloseStore(store);
291     }
292     ReleaseConfig(config);
293 }
294 
OHRdbLockRowFuzzTest(FuzzedDataProvider & provider)295 void OHRdbLockRowFuzzTest(FuzzedDataProvider &provider)
296 {
297     OH_Rdb_Config *config = CreateRandomConfig(provider);
298     int errCode;
299     OH_Rdb_Store *store = OH_Rdb_GetOrOpen(config, &errCode);
300     if (store != nullptr) {
301         OH_Predicates *predicates = CreateRandomPredicates(provider);
302         if (predicates != nullptr) {
303             OH_Rdb_LockRow(store, predicates);
304             predicates->destroy(predicates);
305         }
306         OH_Rdb_CloseStore(store);
307     }
308     ReleaseConfig(config);
309 }
310 
OHRdbCreateTransactionFuzzTest(FuzzedDataProvider & provider)311 void OHRdbCreateTransactionFuzzTest(FuzzedDataProvider &provider)
312 {
313     OH_Rdb_Config *config = CreateRandomConfig(provider);
314     int errCode;
315     OH_Rdb_Store *store = OH_Rdb_GetOrOpen(config, &errCode);
316     if (store != nullptr) {
317         OH_RDB_TransOptions *options = CreateRandomTransOptions(provider);
318         OH_Rdb_Transaction *trans = nullptr;
319         OH_Rdb_CreateTransaction(store, options, &trans);
320         OH_Rdb_CloseStore(store);
321     }
322     ReleaseConfig(config);
323 }
324 
OHRdbCommitByTrxIdFuzzTest(FuzzedDataProvider & provider)325 void OHRdbCommitByTrxIdFuzzTest(FuzzedDataProvider &provider)
326 {
327     OH_Rdb_Config *config = CreateRandomConfig(provider);
328     int errCode;
329     OH_Rdb_Store *store = OH_Rdb_GetOrOpen(config, &errCode);
330     if (store != nullptr) {
331         int64_t trxId = provider.ConsumeIntegral<int64_t>();
332         OH_Rdb_CommitByTrxId(store, trxId);
333         OH_Rdb_CloseStore(store);
334     }
335     ReleaseConfig(config);
336 }
337 
OHRdbBackupFuzzTest(FuzzedDataProvider & provider)338 void OHRdbBackupFuzzTest(FuzzedDataProvider &provider)
339 {
340     OH_Rdb_Config *config = CreateRandomConfig(provider);
341     int errCode;
342     OH_Rdb_Store *store = OH_Rdb_GetOrOpen(config, &errCode);
343     if (store != nullptr) {
344         std::string databasePath = provider.ConsumeRandomLengthString();
345         OH_Rdb_Backup(store, databasePath.c_str());
346         OH_Rdb_CloseStore(store);
347     }
348     ReleaseConfig(config);
349 }
350 
OHRdbUnsubscribeAutoSyncProgressFuzzTest(FuzzedDataProvider & provider)351 void OHRdbUnsubscribeAutoSyncProgressFuzzTest(FuzzedDataProvider &provider)
352 {
353     OH_Rdb_Config *config = CreateRandomConfig(provider);
354     int errCode;
355     OH_Rdb_Store *store = OH_Rdb_GetOrOpen(config, &errCode);
356     if (store != nullptr) {
357         Rdb_ProgressObserver *observer = nullptr; // Simplified for fuzzing
358         OH_Rdb_UnsubscribeAutoSyncProgress(store, observer);
359         OH_Rdb_CloseStore(store);
360     }
361     ReleaseConfig(config);
362 }
363 
OHRdbUnsubscribeFuzzTest(FuzzedDataProvider & provider)364 void OHRdbUnsubscribeFuzzTest(FuzzedDataProvider &provider)
365 {
366     OH_Rdb_Config *config = CreateRandomConfig(provider);
367     int errCode;
368     OH_Rdb_Store *store = OH_Rdb_GetOrOpen(config, &errCode);
369     if (store != nullptr) {
370         Rdb_SubscribeType type = static_cast<Rdb_SubscribeType>(
371             provider.ConsumeIntegralInRange<int>(RDB_SUBSCRIBE_TYPE_CLOUD, RDB_SUBSCRIBE_TYPE_LOCAL_DETAILS));
372         Rdb_DataObserver *observer = nullptr; // Simplified for fuzzing
373         OH_Rdb_Unsubscribe(store, type, observer);
374         OH_Rdb_CloseStore(store);
375     }
376     ReleaseConfig(config);
377 }
378 
OHRdbExecuteV2FuzzTest(FuzzedDataProvider & provider)379 void OHRdbExecuteV2FuzzTest(FuzzedDataProvider &provider)
380 {
381     OH_Rdb_Config *config = CreateRandomConfig(provider);
382     int errCode;
383     OH_Rdb_Store *store = OH_Rdb_GetOrOpen(config, &errCode);
384     if (store != nullptr) {
385         std::string sql = provider.ConsumeRandomLengthString(100);
386         OH_Data_Values *values = OH_Values_Create();
387         int value = provider.ConsumeIntegral<int>();
388         OH_Values_PutInt(values, value);
389         OH_Data_Value *result = nullptr;
390         OH_Rdb_ExecuteV2(store, sql.c_str(), values, &result);
391         if (values != nullptr) {
392             OH_Values_Destroy(values);
393         }
394         OH_Rdb_CloseStore(store);
395     }
396     ReleaseConfig(config);
397 }
398 
OHRdbFindModifyTimeFuzzTest(FuzzedDataProvider & provider)399 void OHRdbFindModifyTimeFuzzTest(FuzzedDataProvider &provider)
400 {
401     OH_Rdb_Config *config = CreateRandomConfig(provider);
402     int errCode;
403     OH_Rdb_Store *store = OH_Rdb_GetOrOpen(config, &errCode);
404     if (store != nullptr) {
405         std::string tableName = provider.ConsumeRandomLengthString(50);
406         std::string columnName = provider.ConsumeRandomLengthString(50);
407         OH_VObject *values = OH_Rdb_CreateValueObject();
408         if (values != nullptr) {
409             OH_Cursor *cursor = OH_Rdb_FindModifyTime(store, tableName.c_str(), columnName.c_str(), values);
410             if (cursor != nullptr) {
411                 cursor->destroy(cursor);
412             }
413             values->destroy(values);
414         }
415         OH_Rdb_CloseStore(store);
416     }
417     ReleaseConfig(config);
418 }
419 
OHRdbGetFloatVectorCountFuzzTest(FuzzedDataProvider & provider)420 void OHRdbGetFloatVectorCountFuzzTest(FuzzedDataProvider &provider)
421 {
422     OH_Rdb_Config *config = CreateRandomConfig(provider);
423     int errCode;
424     OH_Rdb_Store *store = OH_Rdb_GetOrOpen(config, &errCode);
425     if (store != nullptr) {
426         std::string sql = provider.ConsumeRandomLengthString();
427         OH_Data_Values *args = nullptr; // Simplified for fuzzing
428         OH_Cursor *cursor = OH_Rdb_ExecuteQueryV2(store, sql.c_str(), args);
429         if (cursor != nullptr) {
430             int columnIndex = provider.ConsumeIntegral<int>();
431             size_t length = provider.ConsumeIntegral<size_t>();
432             OH_Cursor_GetFloatVectorCount(cursor, columnIndex, &length);
433             cursor->destroy(cursor);
434         }
435         OH_Rdb_CloseStore(store);
436     }
437     ReleaseConfig(config);
438 }
439 
OHRdbGetFloatVectorFuzzTest(FuzzedDataProvider & provider)440 void OHRdbGetFloatVectorFuzzTest(FuzzedDataProvider &provider)
441 {
442     OH_Rdb_Config *config = CreateRandomConfig(provider);
443     int errCode;
444     OH_Rdb_Store *store = OH_Rdb_GetOrOpen(config, &errCode);
445     if (store != nullptr) {
446         std::string sql = provider.ConsumeRandomLengthString();
447         OH_Data_Values *args = nullptr; // Simplified for fuzzing
448         OH_Cursor *cursor = OH_Rdb_ExecuteQueryV2(store, sql.c_str(), args);
449         if (cursor != nullptr) {
450             int columnIndex = provider.ConsumeIntegral<int>();
451             float *val = new float();
452             size_t inLen = provider.ConsumeIntegral<size_t>();
453             size_t outLen = provider.ConsumeIntegral<size_t>();
454             OH_Cursor_GetFloatVector(cursor, columnIndex, val, inLen, &outLen);
455             delete val;
456             cursor->destroy(cursor);
457         }
458         OH_Rdb_CloseStore(store);
459     }
460     ReleaseConfig(config);
461 }
462 
RelationalStoreFuzzTest(FuzzedDataProvider & provider)463 void RelationalStoreFuzzTest(FuzzedDataProvider &provider)
464 {
465     // Test OH_Rdb_CreateOrOpen
466     OHRdbCreateOrOpenFuzzTest(provider);
467 
468     // Test OH_Rdb_CreateOrOpenV2
469     OHRdbCreateOrOpenV2FuzzTest(provider);
470 
471     // Test OH_Rdb_SetVersion
472     OHRdbSetVersionFuzzTest(provider);
473 
474     // Test OH_Rdb_QueryLockedRow
475     OHRdbQueryLockedRowFuzzTest(provider);
476 
477     // Test OH_Rdb_UnlockRow
478     OHRdbUnlockRowFuzzTest(provider);
479 
480     // Test OH_Rdb_ExecuteQueryV2
481     OHRdbExecuteQueryV2FuzzTest(provider);
482 
483     // Test OH_Rdb_BatchInsert
484     OHRdbBatchInsertFuzzTest(provider);
485 
486     // Test OH_Rdb_Update
487     OHRdbUpdateFuzzTest(provider);
488 
489     // Test OH_Rdb_LockRow
490     OHRdbLockRowFuzzTest(provider);
491 
492     // Test OH_Rdb_CreateTransaction
493     OHRdbCreateTransactionFuzzTest(provider);
494 
495     // Test OH_Rdb_CommitByTrxId
496     OHRdbCommitByTrxIdFuzzTest(provider);
497 
498     // Test OH_Rdb_Backup
499     OHRdbBackupFuzzTest(provider);
500 
501     // Test OH_Rdb_UnsubscribeAutoSyncProgress
502     OHRdbUnsubscribeAutoSyncProgressFuzzTest(provider);
503 
504     // Test OH_Rdb_Unsubscribe
505     OHRdbUnsubscribeFuzzTest(provider);
506 
507     // Test OH_Rdb_ExecuteV2
508     OHRdbExecuteV2FuzzTest(provider);
509 
510     // Test OH_Rdb_FindModifyTime
511     OHRdbFindModifyTimeFuzzTest(provider);
512 
513     // Test OH_Cursor_GetFloatVectorCount
514     OHRdbGetFloatVectorCountFuzzTest(provider);
515 
516     // Test OH_Cursor_GetFloatVector
517     OHRdbGetFloatVectorFuzzTest(provider);
518 }
519 
520 /* Fuzzer entry point */
LLVMFuzzerTestOneInput(const uint8_t * data,size_t size)521 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
522 {
523     FuzzedDataProvider provider(data, size);
524     RelationalStoreFuzzTest(provider);
525     return 0;
526 }
527