We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b1fa549 + faf49b1 commit b6db2d5Copy full SHA for b6db2d5
obex/javax/obex/ServerOperation.java
@@ -397,11 +397,13 @@ public synchronized boolean sendReply(int type) throws IOException {
397
&& (headerID != ObexHelper.OBEX_OPCODE_GET_FINAL)) {
398
399
if (length > 3) {
400
- byte[] temp = new byte[length];
+ byte[] temp = new byte[length - 3];
401
+ // First three bytes already read, compensating for this
402
bytesReceived = mInput.read(temp);
403
- while (bytesReceived != length) {
404
- bytesReceived += mInput.read(temp, bytesReceived, length - bytesReceived);
+ while (bytesReceived != temp.length) {
405
+ bytesReceived += mInput.read(temp, bytesReceived,
406
+ temp.length - bytesReceived);
407
}
408
409
0 commit comments