From ba54aca3a47df0e8c7afde968bd5f7479372a404 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sat, 24 Oct 2026 03:43:34 +0200 Subject: factor out accesslist parser to fix a potential out of bound read and add tests to the accesslist unit --- ot_accesslist.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ot_accesslist.h') diff --git a/ot_accesslist.h b/ot_accesslist.h index d05e1f7..b3e979d 100644 --- a/ot_accesslist.h +++ b/ot_accesslist.h @@ -19,6 +19,10 @@ void accesslist_deinit(void); int accesslist_hashisvalid(ot_hash hash); void accesslist_cleanup(void); +/* Scan buf for up to capacity info_hashes in hexadecimal notation, one per + line, and return how many were written to dest */ +size_t accesslist_parse_hashes(ot_hash *dest, size_t capacity, const char *buf, size_t len); + extern char *g_accesslist_filename; #ifdef WANT_DYNAMIC_ACCESSLIST extern char *g_accesslist_pipe_add; -- cgit v1.3