mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-02 22:30:49 +01:00
clients: fix potential crash due to wrong sort function
g_qsort_with_data() passes the pointers to the compared items to the
compare function, that is not the "const char *" pointers itself.
Fixes: 41976e3069
This commit is contained in:
parent
e108f1cfaf
commit
c629378d2e
1 changed files with 1 additions and 7 deletions
|
|
@ -95,12 +95,6 @@ nm_vpn_get_plugins (void)
|
|||
return plugins;
|
||||
}
|
||||
|
||||
static int
|
||||
_strcmp_data (gconstpointer a, gconstpointer b, gpointer unused)
|
||||
{
|
||||
return strcmp (a, b);
|
||||
}
|
||||
|
||||
const char **
|
||||
nm_vpn_get_plugin_names (gboolean only_available_plugins)
|
||||
{
|
||||
|
|
@ -132,7 +126,7 @@ nm_vpn_get_plugin_names (gboolean only_available_plugins)
|
|||
list[i++] = known_names[j];
|
||||
}
|
||||
|
||||
g_qsort_with_data (list, i, sizeof (gpointer), _strcmp_data, NULL);
|
||||
g_qsort_with_data (list, i, sizeof (gpointer), nm_strcmp_p_with_data, NULL);
|
||||
|
||||
/* remove duplicates */
|
||||
for (k = 0, j = 1; j < i; j++) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue