From 8103daff293c19dc4e88af36610744c8c4acd168 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 12 Oct 2010 11:08:08 +0300 Subject: [PATCH] obexd: Fix possible NULL pointer deference Variable "os->driver" tracked as NULL. --- obexd/src/obex.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/obexd/src/obex.c b/obexd/src/obex.c index ab7125c24..3bae9d430 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; } -- 2.47.3