mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
channeld: don't asort(NULL).
It's defined to be nonull: ``` channeld/channeld.c:2381:2: runtime error: null pointer passed as argument 1, which is declared to never be null /usr/include/stdlib.h:856:3: note: nonnull attribute specified here SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior channeld/channeld.c:2381:2 in ``` Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -2368,7 +2368,8 @@ static void resend_commitment(struct peer *peer, struct changed_htlc *last)
|
||||
* is to sort them all into ascending ID order here (we could do
|
||||
* this when we save them in channel_sending_commit, but older versions
|
||||
* won't have them sorted in the db, so doing it here is better). */
|
||||
asort(last, tal_count(last), cmp_changed_htlc_id, NULL);
|
||||
if (last)
|
||||
asort(last, tal_count(last), cmp_changed_htlc_id, NULL);
|
||||
|
||||
/* BOLT #2:
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user