summaryrefslogtreecommitdiffstats
path: root/obex
diff options
context:
space:
mode:
Diffstat (limited to 'obex')
-rw-r--r--obex/javax/obex/ServerOperation.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/obex/javax/obex/ServerOperation.java b/obex/javax/obex/ServerOperation.java
index 07a3a53..d1476d2 100644
--- a/obex/javax/obex/ServerOperation.java
+++ b/obex/javax/obex/ServerOperation.java
@@ -397,11 +397,13 @@ public final class ServerOperation implements Operation, BaseStream {
&& (headerID != ObexHelper.OBEX_OPCODE_GET_FINAL)) {
if (length > 3) {
- byte[] temp = new byte[length];
+ byte[] temp = new byte[length - 3];
+ // First three bytes already read, compensating for this
bytesReceived = mInput.read(temp);
- while (bytesReceived != length) {
- bytesReceived += mInput.read(temp, bytesReceived, length - bytesReceived);
+ while (bytesReceived != temp.length) {
+ bytesReceived += mInput.read(temp, bytesReceived,
+ temp.length - bytesReceived);
}
}