core: avoid undefined behavior comparing plain pointer values in _cmp_last_resort()

(cherry picked from commit 85df025e93)
This commit is contained in:
Thomas Haller 2021-06-15 00:47:59 +02:00
parent 5ccbe04788
commit c5914709f2
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -2084,7 +2084,9 @@ _cmp_last_resort(NMSettingsConnection *a, NMSettingsConnection *b)
/* hm, same UUID. Use their pointer value to give them a stable
* order. */
return (a > b) ? -1 : 1;
NM_CMP_DIRECT_PTR(a, b);
return nm_assert_unreachable_val(0);
}
/* sorting for "best" connections.