Skip to content
Snippets Groups Projects

Fix the global-buffer-overflow in tiffset

Merged 4ugustus requested to merge waugustus/libtiff:master into master
2 unresolved threads

fixing the global-buffer-overflow bug in tiffset, which is described in #355 (closed).

Edited by 4ugustus

Merge request reports

Pipeline #455480973 failed

Pipeline failed for 0a827a98 on waugustus:master

Approval is optional

Merged by Even RouaultEven Rouault 3 years ago (Jan 25, 2022 4:25pm UTC)

Merge details

  • Changes merged into master with 49396659 (commits were squashed).
  • Did not delete the source branch.

Pipeline #456046602 passed

Pipeline passed for 49396659 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • 4ugustus changed title from fixing global-buffer-overflow in tiffset to Fix the global-buffer-overflow in tiffset

    changed title from fixing global-buffer-overflow in tiffset to Fix the global-buffer-overflow in tiffset

    • The call TIFFSetField(tiff, TIFFFieldTag(fip),(uint16_t)len, argv[arg_index]) expects as len a uint32_t parameter for ASCII tags with passcount=true. This works for TIFFSetField() because of va_arg variable promotion, but would not work for TIFFGetField(). Hence, the cast of the uint32_t len to (uint16_t)len is superfluous.

      By the way, for handling of unknown (anonymous) tags see the discussion at #353 (closed).
      In this case, the read/write interface for TIFFSetField() and TIFFGetField() for an unknown TIFF_ASCII tag is defined by the _TIFFCreateAnonField() function as TIFF_SETGET_C32_ASCII.
      Actually, simple ASCII tags with variable character length are defined with the interface as TIFF_SETGET_ASCII.
      TIFF_SETGET_C16_ASCII or TIFF_SETGET_C32_ASCII is used for string arrays, such as at the TIFFTAG_INKNAMES tag.

  • 4ugustus added 1 commit

    added 1 commit

    • 0cf67888 - Apply 4 suggestion(s) to 1 file(s)

    Compare with previous version

  • 4ugustus added 1 commit

    added 1 commit

    Compare with previous version

  • Even Rouault mentioned in commit 49396659

    mentioned in commit 49396659

  • merged

  • Please register or sign in to reply
    Loading