[all-commits] [llvm/llvm-project] 49285f: [analyzer] sprintf is a taint propagator not a source

Balazs Benics via All-commits all-commits at lists.llvm.org
Thu Oct 28 02:03:30 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 49285f43e5ed17206235e43c9cd17762d77ed275
      https://github.com/llvm/llvm-project/commit/49285f43e5ed17206235e43c9cd17762d77ed275
  Author: Balazs Benics <balazs.benics at sigmatechnology.se>
  Date:   2021-10-28 (Thu, 28 Oct 2021)

  Changed paths:
    M clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
    M clang/test/Analysis/taint-generic.c

  Log Message:
  -----------
  [analyzer] sprintf is a taint propagator not a source

Due to a typo, `sprintf()` was recognized as a taint source instead of a
taint propagator. It was because an empty taint source list - which is
the first parameter of the `TaintPropagationRule` - encoded the
unconditional taint sources.
This typo effectively turned the `sprintf()` into an unconditional taint
source.

This patch fixes that typo and demonstrated the correct behavior with
tests.

Reviewed By: martong

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




More information about the All-commits mailing list