MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_write

Function test_write

tests/fuzz/fuzz-connectd-handshake-act1.c:21–35  ·  view source on GitHub ↗

The io_write() interceptor. * * If the fuzzer-generated Act 1 packet was valid, this should be called exactly * once. Otherwise it should not be called at all. */

Source from the content-addressed store, hash-verified

19 * If the fuzzer-generated Act 1 packet was valid, this should be called exactly
20 * once. Otherwise it should not be called at all. */
21static struct io_plan *
22test_write(struct io_conn *conn, const void *data, size_t len,
23 struct io_plan *(*next)(struct io_conn *, struct handshake *),
24 struct handshake *h)
25{
26 ++write_count;
27 assert(write_count == 1 && "too many calls to io_write()");
28
29 /* Act 1 packet validation succeeded. Responder is sending the Act 2
30 * packet. Check that it is initialized. */
31 assert(len == ACT_TWO_SIZE);
32 memcheck(data, len);
33
34 return handshake_failed(conn, h);
35}
36
37/* The io_read() interceptor.
38 *

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected