Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 1/4] Fix possible NULL pointer deference
@ 2010-10-12  8:08 Luiz Augusto von Dentz
  2010-10-12  8:08 ` [PATCH 2/4] " Luiz Augusto von Dentz
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Luiz Augusto von Dentz @ 2010-10-12  8:08 UTC (permalink / raw)
  To: linux-bluetooth

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

Variable "os->driver" tracked as NULL.
---
 src/obex.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/obex.c b/src/obex.c
index 92d3b5c..8d12f8f 100644
--- a/src/obex.c
+++ b/src/obex.c
@@ -589,7 +589,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;
 	}
-- 
1.7.1


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

end of thread, other threads:[~2010-10-12  9:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-12  8:08 [PATCH 1/4] Fix possible NULL pointer deference Luiz Augusto von Dentz
2010-10-12  8:08 ` [PATCH 2/4] " Luiz Augusto von Dentz
2010-10-12  9:38   ` Johan Hedberg
2010-10-12  8:08 ` [PATCH 3/4] Fix dead statement Luiz Augusto von Dentz
2010-10-12  9:39   ` Johan Hedberg
2010-10-12  8:08 ` [PATCH 4/4] Fix possible use of uninitialized variables Luiz Augusto von Dentz
2010-10-12  9:39   ` Johan Hedberg
2010-10-12  9:38 ` [PATCH 1/4] Fix possible NULL pointer deference Johan Hedberg

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