mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-07 18:20:22 +01:00
core: avoid undefined behavior comparing plain pointer values in _cmp_last_resort()
(cherry picked from commit 85df025e93)
This commit is contained in:
parent
5ccbe04788
commit
c5914709f2
1 changed files with 3 additions and 1 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue