Skip to contentSkip to conversation

Fix possible crash when using syncevolution plugin

PATCH Applied Luiz Augusto von Dentz 2 participants 2 messages Oct 6, 2011 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 Fix possible crash when using syncevolution plugin

From: Luiz Augusto von Dentz <[email protected]>

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(-)
plugins/syncevolution.c +4 -1
index ae13e43..a389783 100644
@@ -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;
 }
Signature · 1 line
1.7.6.4
#1 lore raw

Hi Luiz,

Quoted 5 lines · Luiz Augusto von Dentz

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(-)

Applied. Thanks.

Johan