aboutsummaryrefslogtreecommitdiffstats
path: root/librecrypt_settings_prefix.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-05-15 20:53:25 +0200
committerMattias Andrée <m@maandree.se>2026-05-15 20:53:25 +0200
commit193d39d9b78a9e3c0c257b2e1e9f9dd4a7a13349 (patch)
treec3b4eaf8df53babc7e37df4384d1be3be1cd9186 /librecrypt_settings_prefix.c
parentFix some minor issues (diff)
downloadlibrecrypt-193d39d9b78a9e3c0c257b2e1e9f9dd4a7a13349.tar.gz
librecrypt-193d39d9b78a9e3c0c257b2e1e9f9dd4a7a13349.tar.bz2
librecrypt-193d39d9b78a9e3c0c257b2e1e9f9dd4a7a13349.tar.xz
Misc
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
-rw-r--r--librecrypt_settings_prefix.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/librecrypt_settings_prefix.c b/librecrypt_settings_prefix.c
index a2a75f9..0d78c23 100644
--- a/librecrypt_settings_prefix.c
+++ b/librecrypt_settings_prefix.c
@@ -55,6 +55,7 @@ out:
#else
+# ifndef FUZZ
#define CHECK_NULL(PREFIX, SUFFIX)\
@@ -154,4 +155,24 @@ main(void)
}
+# else
+
+
+int
+LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
+{
+ char *hash;
+ size_t r;
+ hash = malloc(size + 1u);
+ assert(hash);
+ memcpy(hash, data, size);
+ hash[size] = '\0';
+ r = librecrypt_settings_prefix(hash, &(size_t){0u});
+ EXPECT(librecrypt_settings_prefix(hash, NULL) == r);
+ free(hash);
+ return 0;
+}
+
+
+# endif
#endif