summaryrefslogtreecommitdiff
path: root/src/or/buffers.h
diff options
context:
space:
mode:
authorteor <teor2345@gmail.com>2016-12-13 19:13:57 -0500
committerNick Mathewson <nickm@torproject.org>2016-12-19 15:02:08 -0500
commitfca91a7793f24fc5f2d043167317fd47dd58f1ed (patch)
tree7eb9c2055c64fda9cca1e1c5735b58ff88531a11 /src/or/buffers.h
parent02068c6391fc5b9febac1f02de7028688c92eee2 (diff)
downloadtor-fca91a7793f24fc5f2d043167317fd47dd58f1ed.tar.gz
tor-fca91a7793f24fc5f2d043167317fd47dd58f1ed.zip
for fuzzing: Add a function to make a buf with given contents
(Teor wrote the code, nick extracted it into a smaller patch.)
Diffstat (limited to 'src/or/buffers.h')
-rw-r--r--src/or/buffers.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/or/buffers.h b/src/or/buffers.h
index 52b21d5885..08d9471fb7 100644
--- a/src/or/buffers.h
+++ b/src/or/buffers.h
@@ -64,7 +64,10 @@ void assert_buf_ok(buf_t *buf);
#ifdef BUFFERS_PRIVATE
STATIC int buf_find_string_offset(const buf_t *buf, const char *s, size_t n);
STATIC void buf_pullup(buf_t *buf, size_t bytes);
+#ifdef TOR_UNIT_TESTS
void buf_get_first_chunk_data(const buf_t *buf, const char **cp, size_t *sz);
+buf_t *buf_new_with_data(const char *cp, size_t sz);
+#endif
STATIC size_t preferred_chunk_size(size_t target);
#define DEBUG_CHUNK_ALLOC