diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2026-10-24 03:43:34 +0200 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2026-10-24 03:43:34 +0200 |
| commit | ba54aca3a47df0e8c7afde968bd5f7479372a404 (patch) | |
| tree | 45c9a42cc13efaf3baa5aacb4297f52fd0adf734 /tests/stubs.c | |
| parent | 131d8b1a79749ca0977a16532c0738fdfc767001 (diff) | |
factor out accesslist parser to fix a potential out of bound read and add tests to the accesslist unit
Diffstat (limited to 'tests/stubs.c')
| -rw-r--r-- | tests/stubs.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/stubs.c b/tests/stubs.c index ae40306..febdd7b 100644 --- a/tests/stubs.c +++ b/tests/stubs.c | |||
| @@ -12,3 +12,23 @@ | |||
| 12 | 12 | ||
| 13 | /* ot_vector.c calls this from vector_clean_list, which no test drives yet. */ | 13 | /* ot_vector.c calls this from vector_clean_list, which no test drives yet. */ |
| 14 | void free_peerlist(ot_peerlist *peer_list) { (void)peer_list; } | 14 | void free_peerlist(ot_peerlist *peer_list) { (void)peer_list; } |
| 15 | |||
| 16 | /* ot_accesslist.c is built with WANT_ACCESSLIST_BLACK so that the hash parser | ||
| 17 | is reachable. These four belong to accesslist_readfile and the reload | ||
| 18 | worker, neither of which any test drives. */ | ||
| 19 | time_t g_now_seconds; | ||
| 20 | volatile int g_opentracker_running; | ||
| 21 | |||
| 22 | const char *mmap_read(const char *filename, size_t *filesize); | ||
| 23 | const char *mmap_read(const char *filename, size_t *filesize) { | ||
| 24 | (void)filename; | ||
| 25 | *filesize = 0; | ||
| 26 | return NULL; | ||
| 27 | } | ||
| 28 | |||
| 29 | int mmap_unmap(const char *mapped, size_t maplen); | ||
| 30 | int mmap_unmap(const char *mapped, size_t maplen) { | ||
| 31 | (void)mapped; | ||
| 32 | (void)maplen; | ||
| 33 | return 0; | ||
| 34 | } | ||
