1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-25 18:15:49 +01:00

fixed off-by-one error

This commit is contained in:
Daniel Dakhno 2020-01-06 15:07:52 +01:00
parent eb14715ef6
commit fb8b4b4ce6

View File

@ -34,8 +34,8 @@ public class AssetFilePutRequest extends FilePutRequest {
}
private static byte[] prepareFileData(AssetFile file){
int size = file.getFileName().length() + file.getFileData().length;
ByteBuffer buffer = ByteBuffer.allocate(size + 3);
int size = file.getFileName().length() + file.getFileData().length + 1 /**null byte **/;
ByteBuffer buffer = ByteBuffer.allocate(size + 2);
buffer.order(ByteOrder.LITTLE_ENDIAN);