mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-21 14:24:09 +01:00
common: disable node ID check when fuzzing
This commit is contained in:
parent
6334797991
commit
15c8ca9284
1 changed files with 5 additions and 1 deletions
|
@ -58,7 +58,11 @@ void fromwire_node_id(const u8 **cursor, size_t *max, struct node_id *id)
|
|||
|
||||
void towire_node_id(u8 **pptr, const struct node_id *id)
|
||||
{
|
||||
/* Cheap sanity check */
|
||||
#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
/* Cheap sanity check. For wire fuzzing, we only care about correct
|
||||
* encoding of node IDs and not whether the IDs are valid, so we disable
|
||||
* this check while fuzzing. */
|
||||
assert(id->k[0] == 0x2 || id->k[0] == 0x3);
|
||||
#endif
|
||||
towire(pptr, id->k, sizeof(id->k));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue