bitcoin/script: don't memcmp NULL.

Stupid, stupid C committee.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2023-04-01 14:11:23 +10:30
parent 2005ca436e
commit 1f8a4bed39
1 changed files with 2 additions and 0 deletions

View File

@ -884,5 +884,7 @@ bool scripteq(const u8 *s1, const u8 *s2)
if (tal_count(s1) != tal_count(s2))
return false;
if (tal_count(s1) == 0)
return true;
return memcmp(s1, s2, tal_count(s1)) == 0;
}