mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-31 20:40:18 +01:00
libnm-keyfile: ensure g_key_file_get_groups() sets the length argument
Under certain cases, if g_key_file_get_groups() fails, it might not set the
out argument @length. Play it safe and initialize it.
(cherry picked from commit aa7a53bc67)
This commit is contained in:
parent
53dcdf8516
commit
519ea3f0d4
1 changed files with 2 additions and 0 deletions
|
|
@ -1577,6 +1577,8 @@ nm_keyfile_read (GKeyFile *keyfile,
|
|||
info.user_data = user_data;
|
||||
|
||||
groups = g_key_file_get_groups (keyfile, &length);
|
||||
if (!groups)
|
||||
length = 0;
|
||||
for (i = 0; i < length; i++) {
|
||||
/* Only read out secrets when needed */
|
||||
if (!strcmp (groups[i], VPN_SECRETS_GROUP)) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue