From fb8b4b4ce67f7c6f6861c028af9909579c148932 Mon Sep 17 00:00:00 2001 From: Daniel Dakhno Date: Mon, 6 Jan 2020 15:07:52 +0100 Subject: [PATCH] fixed off-by-one error --- .../qhybrid/requests/fossil_hr/file/AssetFilePutRequest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/requests/fossil_hr/file/AssetFilePutRequest.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/requests/fossil_hr/file/AssetFilePutRequest.java index 90487c4fc..dd2935a25 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/requests/fossil_hr/file/AssetFilePutRequest.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/requests/fossil_hr/file/AssetFilePutRequest.java @@ -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);