Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit a71bac5d authored by Sravan Kumar V's avatar Sravan Kumar V Committed by Andre Eisenbach
Browse files

OPP: Check file size before send to prevent crash

Use case :
1. Send large file to dut (Above 4 GB)
Failure:
Crash in com.android.bluetooth.
Process: com.android.bluetooth
java.lang.IllegalArgumentException: Length must be
   between 0 and 0xFFFFFFFF
at javax.obex.HeaderSet.setHeader(HeaderSet.java:333)
at com.android.bluetooth.opp.BluetoothOppObexClientSession$ClientThread
   .sendFile(BluetoothOppObexClientSession.java:411)
at com.android.bluetooth.opp.BluetoothOppObexClientSession$ClientThread
    .doSend(BluetoothOppObexClientSession.java:337)

Root cause :
Largest length in OBEX message header is unsigned 4 bytes, so actual
file length (4 GB) cannot be written into Obex header which leads
to exception in OBEX code.

Fix :
Add length check before push file and skip sendfile if length is above
4GB to prevent crash.

Change-Id: I9066fb7456d85fdc197fe21fed26fb2bb89ff09e
parent 684fc377
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment