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

Commit ebb1081a authored by Marco Nelissen's avatar Marco Nelissen
Browse files

Fix buffer allocation

b/15293123

Change-Id: Icb3ceabf02a55bc931baaf388ce125db6332de0e
parent ccaffa8d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -363,7 +363,7 @@ int MtpDataPacket::write(int fd) {
}

int MtpDataPacket::writeData(int fd, void* data, uint32_t length) {
    allocate(length);
    allocate(length + MTP_CONTAINER_HEADER_SIZE);
    memcpy(mBuffer + MTP_CONTAINER_HEADER_SIZE, data, length);
    length += MTP_CONTAINER_HEADER_SIZE;
    MtpPacket::putUInt32(MTP_CONTAINER_LENGTH_OFFSET, length);