Open Source Telephony
 help / color / mirror / Atom feed
* [PATCH] simfs: Prevent a crash in sim_fs_notify_file_watches
@ 2017-05-12 15:40 Slava Monich
  2017-05-12 19:37 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Slava Monich @ 2017-05-12 15:40 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 685 bytes --]

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] simfs: Prevent a crash in sim_fs_notify_file_watches
  2017-05-12 15:40 [PATCH] simfs: Prevent a crash in sim_fs_notify_file_watches Slava Monich
@ 2017-05-12 19:37 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2017-05-12 19:37 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 315 bytes --]

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-12 19:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-12 15:40 [PATCH] simfs: Prevent a crash in sim_fs_notify_file_watches Slava Monich
2017-05-12 19:37 ` Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox