Compare commits

...

4 Commits

Author SHA1 Message Date
Slava Monich
4ae4d688ce Merge pull request #41 from monich/uaf
Fix use after free
2023-01-02 11:13:43 +02:00
Slava Monich
224b551feb [voicecall] Fix use after free. JB#54354
Thanks to Denis Grigorev for pointing it out.
2023-01-02 00:38:40 +02:00
Slava Monich
6acf808d89 Merge pull request #38 from monich/conf-mask
Allow merging mask conf values
2022-11-07 16:37:19 +02:00
Slava Monich
942b2efc3b [ofono] Allow merging mask conf values. JB#59210
To allow syntax like disableFeatures += voice
2022-11-07 16:17:36 +02:00
2 changed files with 9 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
/*
* oFono - Open Source Telephony
*
* Copyright (C) 2015-2021 Jolla Ltd.
* Copyright (C) 2015-2022 Jolla Ltd.
* Copyright (C) 2019 Open Mobile Platform LLC.
*
* This program is free software; you can redistribute it and/or modify
@@ -243,6 +243,7 @@ static void conf_merge_group(GKeyFile *conf, GKeyFile *k, const char *group)
group, key, &count, NULL);
key[len-1] = 0;
g_strchomp(key); /* Strip spaces before + */
conf_list_append(conf, k, group, key,
values, count, last == '?');
g_strfreev(values);
@@ -252,6 +253,7 @@ static void conf_merge_group(GKeyFile *conf, GKeyFile *k, const char *group)
group, key, &count, NULL);
key[len-1] = 0;
g_strchomp(key); /* Strip spaces before - */
conf_list_remove(conf, k, group, key,
values, count);
g_strfreev(values);
@@ -531,13 +533,16 @@ gboolean ofono_conf_get_mask(GKeyFile *file, const char *group,
char **values, **ptr;
if (comment) *comment = 0;
values = g_strsplit(str, "+", -1);
values = g_strsplit_set(str, "+,", -1);
for (ok = TRUE, ptr = values; *ptr && ok; ptr++) {
const char* found_str = NULL;
const char* s = g_strstrip(*ptr);
if (!strcasecmp(s, name)) {
if (!s[0]) {
/* Ignore empty entries */
continue;
} else if (!strcasecmp(s, name)) {
found_str = name;
if (result) {
*result |= value;

View File

@@ -2665,9 +2665,9 @@ void ofono_voicecall_disconnected(struct ofono_voicecall *vc, int id,
if (l) {
/* Incoming call was disconnected in the process of being
* filtered. voicecall_destroy cancels it. */
voicecall_destroy(l->data);
vc->incoming_filter_list = g_slist_delete_link
(vc->incoming_filter_list, l);
voicecall_destroy(l->data);
return;
}