Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • L libtiff
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 159
    • Issues 159
    • List
    • Boards
    • Service Desk
    • Milestones
    • Requirements
  • Merge requests 21
    • Merge requests 21
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • libtiff
  • libtiff
  • Issues
  • #309
Closed
Open
Issue created Nov 16, 2021 by Kurt Schwehr@schwehrContributor

TiffAppendToStrip - rewrite-in-place logic tries to malloc with a size of 0 bytes

Summary

I am seeing a tempSize of 0 being passed to malloc here:

https://gitlab.com/libtiff/libtiff/-/blob/59135f73dd0341da9080098ac7c56284695c3734/libtiff/tif_write.c#L832

uint64_t toCopy = td->td_stripbytecount_p[strip];

        if( toCopy < 1024 * 1024 )
            tempSize = (tmsize_t)toCopy;
        else
            tempSize = 1024 * 1024;
//...

temp = _TIFFmalloc(tempSize);
        if (temp == NULL) {
            TIFFErrorExt(tif->tif_clientdata, module, "No space for output buffer");
            return (0);
        }

Version

59135f73

Steps to reproduce

We don't currently have a reproducer since this is happening with protected user data. Where the user is not me. It's in a cloud flume worker.

Platform

  • Custom: Linux, x86_64, google3/blaze built.
  • Called from GDAL from 2018-Nov-02 - https://github.com/OSGeo/gdal/commit/e5e7b313540f0ff913fadfe6a273fb7c356a22cb
Assignee
Assign to
Time tracking