[llvm-bugs] [Bug 37687] New: Incorrect destination buffer size calculation for strlcat

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jun 5 04:41:56 PDT 2018


            Bug ID: 37687
           Summary: Incorrect destination buffer size calculation for
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
          Assignee: dcoughlin at apple.com
          Reporter: edwin.mons at isode.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 20396
  --> https://bugs.llvm.org/attachment.cgi?id=20396&action=edit
Additional test for bsd-string.cpp

I noticed a lot of analyzer noise on a scan-build run after an upgrade to a
recent Clang trunk build, all complaining about strlcat, and all look like they
are false positives.  In short, it will complain about strlcat(dest, src,
sizeof(dest)), which according to the BSD manuals is a correct way to use this
function.  I suspect size is checked as if it concerned strncat.  An addition
to the check-clang-analyzer test suite is attached.

I reproduced this on Debian 9 using clang trunk (checked out using git, commit
e6a11c7e15).  I don't think this is platform-specific.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180605/b82b62b7/attachment.html>

More information about the llvm-bugs mailing list