Re: [PATCH] simfs: Prevent a crash in sim_fs_notify_file_watches

2017-05-12 Thread Denis Kenzior

Hi Slava,

On 05/12/2017 10:40 AM, Slava Monich wrote:

If no file watchers have ever been added, context->file_watches
is NULL and sim_fs_notify_file_watches() should take that into
account.
---
 src/simfs.c | 3 +++
 1 file changed, 3 insertions(+)



Applies, thanks.

Regards,
-Denis

___
ofono mailing list
ofono@ofono.org
https://lists.ofono.org/mailman/listinfo/ofono


[PATCH] simfs: Prevent a crash in sim_fs_notify_file_watches

2017-05-12 Thread Slava Monich
If no file watchers have ever been added, context->file_watches
is NULL and sim_fs_notify_file_watches() should take that into
account.
---
 src/simfs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/simfs.c b/src/simfs.c
index 595dbad..37a232a 100644
--- a/src/simfs.c
+++ b/src/simfs.c
@@ -226,6 +226,9 @@ void sim_fs_notify_file_watches(struct sim_fs *fs, int id)
struct ofono_sim_context *context = l->data;
GSList *k;
 
+   if (context->file_watches == NULL)
+   continue;
+
for (k = context->file_watches->items; k; k = k->next) {
struct file_watch *w = k->data;
ofono_sim_file_changed_cb_t notify = w->item.notify;
-- 
1.9.1

___
ofono mailing list
ofono@ofono.org
https://lists.ofono.org/mailman/listinfo/ofono