Diff between 2e7fca9167c1d64257327f47403fd89f45870af6 and 8103daff293c19dc4e88af36610744c8c4acd168

Changed Files

File Additions Deletions Status
obexd/src/obex.c +3 -1 modified

Full Patch

diff --git a/obexd/src/obex.c b/obexd/src/obex.c
index ab7125c..3bae9d4 100644
--- a/obexd/src/obex.c
+++ b/obexd/src/obex.c
@@ -587,7 +587,9 @@ static int obex_read_stream(struct obex_session *os, obex_t *obex,
 	os->buf = g_realloc(os->buf, os->pending + size);
 	memcpy(os->buf + os->pending, buffer, size);
 	os->pending += size;
-	if (os->object == NULL) {
+
+	/* only write if both object and driver are valid */
+	if (os->object == NULL || os->driver == NULL) {
 		DBG("Stored %u bytes into temporary buffer", os->pending);
 		return 0;
 	}