[all-commits] [llvm/llvm-project] 03aa02: [fuzzer] Use puts() rather than printf() in CopyFi...

Roy Sundahl via All-commits all-commits at lists.llvm.org
Fri Mar 17 09:08:58 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 03aa02adb03c928ae4ec9d139b303348f81861c9
      https://github.com/llvm/llvm-project/commit/03aa02adb03c928ae4ec9d139b303348f81861c9
  Author: Roy Sundahl <rsundahl at apple.com>
  Date:   2023-03-17 (Fri, 17 Mar 2023)

  Changed paths:
    M compiler-rt/lib/fuzzer/FuzzerIO.cpp
    M compiler-rt/lib/fuzzer/FuzzerIO.h
    A compiler-rt/test/fuzzer/BigFileCopy.cpp
    A compiler-rt/test/fuzzer/big-file-copy.test

  Log Message:
  -----------
  [fuzzer] Use puts() rather than printf() in CopyFileToErr()

CopyFileToErr() uses Printf("%s", ...) which fails with a negative size on
files >2Gb (Its path is through var-args wrappers to an unnecessary "%s"
expansion and subject to int overflows) Using puts() in place of printf()
bypasses this path and writes the string directly to stderr. This avoids the
present loss of data when a crashed worker has generated >2Gb of output.

rdar://99384640

Reviewed By: yln

Differential Revision: https://reviews.llvm.org/D146189




More information about the All-commits mailing list