diff options
author | Vinicius Costa Gomes <vinicius.gomes@openbossa.org> | 2010-05-20 18:04:06 -0300 |
---|---|---|
committer | Vinicius Costa Gomes <vinicius.gomes@openbossa.org> | 2010-05-21 13:52:00 -0300 |
commit | 2f126779a05ca2604d35ca6badf0bd21ce1a4db6 (patch) | |
tree | d9786e7ef9ccd082b6b8b053d8f86e407c816aed | |
parent | bc4044e8ebf4daeadafc1484c7200d189337214d (diff) | |
download | obexd-2f126779a05ca2604d35ca6badf0bd21ce1a4db6.tar.gz |
Fix crash when receiving small objects
When the received object fits in only one packet, when we reach
obex_read_stream we may not have the driver. We must wait the driver
to be set before writing.
-rw-r--r-- | src/obex.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -332,7 +332,8 @@ static int obex_read_stream(struct obex_session *os, obex_t *obex, if (os->size == OBJECT_SIZE_DELETE) os->size = OBJECT_SIZE_UNKNOWN; - if (os->pending > 0) + /* If there's something to write and we are able to write it */ + if (os->pending > 0 && os->driver) goto write; size = OBEX_ObjectReadStream(obex, obj, &buffer); |