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

Roy Sundahl via All-commits all-commits at lists.llvm.org
Tue Mar 28 14:19:55 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 90b4d1bcb20180c591385131b12fa90d2e4860b1
  Author: Roy Sundahl <rsundahl at apple.com>
  Date:   2023-03-28 (Tue, 28 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.


Reviewed By: yln, rsundahl

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

More information about the All-commits mailing list