linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH obexd] Fix possible crash when using syncevolution plugin
@ 2011-10-06  8:46 Luiz Augusto von Dentz
  2011-10-06  8:59 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2011-10-06  8:46 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

Context os need to be set since synce_write uses it, in addiction
check if context is valid in synce_open.
---
 plugins/syncevolution.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/plugins/syncevolution.c b/plugins/syncevolution.c
index ae13e43..a389783 100644
--- a/plugins/syncevolution.c
+++ b/plugins/syncevolution.c
@@ -230,6 +230,7 @@ static void *synce_connect(struct obex_session *os, int *err)
 	context->dbus_conn = conn;
 	context->lasterr = -EAGAIN;
 	context->id = obex_get_id(os);
+	context->os = os;
 
 	if (err)
 		*err = 0;
@@ -281,8 +282,10 @@ static void synce_disconnect(struct obex_session *os, void *user_data)
 static void *synce_open(const char *name, int oflag, mode_t mode,
 				void *user_data, size_t *size, int *err)
 {
+	struct synce_context *context = user_data;
+
 	if (err)
-		*err = 0;
+		*err = context ? 0 : -EFAULT;
 
 	return user_data;
 }
-- 
1.7.6.4


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

end of thread, other threads:[~2011-10-06  8:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-06  8:46 [PATCH obexd] Fix possible crash when using syncevolution plugin Luiz Augusto von Dentz
2011-10-06  8:59 ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).