mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-12-26 14:44:24 +08:00
Support fuzz testing (#4)
Quickstart (requires Clang 6 or later): $ export LIB_FUZZING_ENGINE=/path/to/fuzzing/library.a $ ./configure --enable-fuzz-testing $ make $ cd src/fuzz $ make fuzz_mdb $ ./fuzz_mdb Also add a new `mdb_open_buffer function` to facilitate in-memory fuzz-testing. This requires fmemopen, which may not be present on all systems. The internal API has been reworked to use file streams instead of file descriptors. This allows reading from memory and reading from files using a consistent API.
This commit is contained in:
@@ -225,9 +225,8 @@ typedef struct {
|
||||
} MdbStatistics;
|
||||
|
||||
typedef struct {
|
||||
int fd;
|
||||
FILE *stream;
|
||||
gboolean writable;
|
||||
char *filename;
|
||||
guint32 jet_version;
|
||||
guint32 db_key;
|
||||
char db_passwd[14];
|
||||
@@ -463,6 +462,7 @@ long mdb_pg_get_int32(MdbHandle *mdb, int offset);
|
||||
float mdb_pg_get_single(MdbHandle *mdb, int offset);
|
||||
double mdb_pg_get_double(MdbHandle *mdb, int offset);
|
||||
MdbHandle *mdb_open(const char *filename, MdbFileFlags flags);
|
||||
MdbHandle *mdb_open_buffer(void *buffer, size_t len, MdbFileFlags flags);
|
||||
void mdb_close(MdbHandle *mdb);
|
||||
MdbHandle *mdb_clone_handle(MdbHandle *mdb);
|
||||
void mdb_swap_pgbuf(MdbHandle *mdb);
|
||||
|
||||
Reference in New Issue
Block a user