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

Function run

tests/fuzz/fuzz-bolt12-offer-decode.c:151–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151void run(const u8 *data, size_t size)
152{
153 struct tlv_offer *offer, *decoded_offer;
154 const char *fail = NULL, *encoded_offer;
155
156 offer = offer_decode(tmpctx, (const char *)data, size,
157 /*feature_set=*/NULL, /*must_be_chain=*/NULL, &fail);
158 if (!offer)
159 goto cleanup;
160
161 encoded_offer = offer_encode(tmpctx, offer);
162
163 decoded_offer = offer_decode(tmpctx, encoded_offer, strlen(encoded_offer),
164 NULL, NULL, &fail);
165 assert(!fail);
166 assert(decoded_offer);
167 assert(tlv_offer_eq(offer, decoded_offer));
168
169cleanup:
170 clean_tmpctx();
171}

Callers

nothing calls this directly

Calls 4

offer_decodeFunction · 0.85
offer_encodeFunction · 0.85
tlv_offer_eqFunction · 0.85
clean_tmpctxFunction · 0.85

Tested by

no test coverage detected