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

Commit eea418fc authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "trusty: apploader: fail specifically if app package is 0 bytes" into...

Merge "trusty: apploader: fail specifically if app package is 0 bytes" into main am: e5bb7ef2 am: f60bfa29 am: ec782d4c

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2863846



Change-Id: I0ef5076473d3c1461a02df7de3157f8e8a0002d0
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 4a4a4c86 ec782d4c
Loading
Loading
Loading
Loading
+7 −2
Original line number Original line Diff line number Diff line
@@ -107,7 +107,11 @@ static unique_fd read_file(const char* file_name, off64_t* out_file_size) {
        return {};
        return {};
    }
    }


    assert(st.st_size >= 0);
    if (st.st_size == 0) {
        LOG(ERROR) << "Zero length file '" << file_name << "'";
        return {};
    }

    file_size = st.st_size;
    file_size = st.st_size;


    /* The dmabuf size needs to be a multiple of the page size */
    /* The dmabuf size needs to be a multiple of the page size */
@@ -123,7 +127,8 @@ static unique_fd read_file(const char* file_name, off64_t* out_file_size) {
    BufferAllocator alloc;
    BufferAllocator alloc;
    unique_fd dmabuf_fd(alloc.Alloc(kDmabufSystemHeapName, file_page_size));
    unique_fd dmabuf_fd(alloc.Alloc(kDmabufSystemHeapName, file_page_size));
    if (!dmabuf_fd.ok()) {
    if (!dmabuf_fd.ok()) {
        LOG(ERROR) << "Error creating dmabuf: " << dmabuf_fd.get();
        LOG(ERROR) << "Error creating dmabuf for " << file_page_size
                   << " bytes: " << dmabuf_fd.get();
        return dmabuf_fd;
        return dmabuf_fd;
    }
    }