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

Function fromwire

wire/fromwire.c:23–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23const u8 *fromwire(const u8 **cursor, size_t *max, void *copy, size_t n)
24{
25 const u8 *p = *cursor;
26
27 if (*max < n) {
28 /* Just make sure we don't leak uninitialized mem! */
29 if (copy)
30 memset(copy, 0, n);
31 if (*cursor)
32 SUPERVERBOSE("less than encoding length");
33 return fromwire_fail(cursor, max);
34 }
35 /* ubsan: runtime error: applying zero offset to null pointer */
36 if (*cursor)
37 *cursor += n;
38 *max -= n;
39 if (copy && n)
40 memcpy(copy, p, n);
41 return memcheck(p, n);
42}
43
44int fromwire_peektypen(const u8 *cursor, size_t max)
45{

Callers 15

fromwire_peektypenFunction · 0.70
fromwire_u8Function · 0.70
fromwire_u16Function · 0.70
fromwire_u32Function · 0.70
fromwire_u64Function · 0.70
fromwire_tlv_uintFunction · 0.70
fromwire_boolFunction · 0.70
fromwire_sha256Function · 0.70
fromwire_ripemd160Function · 0.70
fromwire_u8_arrayFunction · 0.70

Calls 1

fromwire_failFunction · 0.70

Tested by

no test coverage detected