[all-commits] [llvm/llvm-project] a012bc: [analyzer][StdLibraryFunctionsChecker] Elaborate t...

Gabor Marton via All-commits all-commits at lists.llvm.org
Tue Sep 15 07:36:59 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: a012bc4c42e4408a18e4c4d67306b79c576df961
      https://github.com/llvm/llvm-project/commit/a012bc4c42e4408a18e4c4d67306b79c576df961
  Author: Gabor Marton <gabor.marton at ericsson.com>
  Date:   2020-09-15 (Tue, 15 Sep 2020)

  Changed paths:
    M clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
    M clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
    M clang/test/Analysis/Inputs/system-header-simulator.h
    M clang/test/Analysis/analyzer-enabled-checkers.c
    M clang/test/Analysis/std-c-library-functions-arg-constraints.c
    A clang/test/Analysis/std-c-library-functions-vs-stream-checker.c

  Log Message:
  -----------
  [analyzer][StdLibraryFunctionsChecker] Elaborate the summary of fread and fwrite

Add the BufferSize argument constraint to fread and fwrite. This change
itself makes it possible to discover a security critical case, described
in SEI-CERT ARR38-C.

We also add the not-null constraint on the 3rd arguments.

In this patch, I also remove those lambdas that don't take any
parameters (Fwrite, Fread, Getc), thus making the code better
structured.

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




More information about the All-commits mailing list