[PATCH] D120489: [analyzer] Done some changes to detect Uninitialized read by the char array manipulation functions

Balázs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 2 07:56:39 PST 2022


steakhal added a comment.

Please mark the done comments as "done" with the corresponding button prior to submitting an update.



================
Comment at: clang/test/Analysis/bstring_UninitRead.c:67-85
+//===----------------------------------------------------------------------===
+// mempcpy()
+//===----------------------------------------------------------------------===
+
+#ifdef VARIANT
+
+#define __mempcpy_chk BUILTIN(__mempcpy_chk)
----------------
I don't think you should copy these as well.
The matching logic is already tested in `bstring.c`.

That being said, a single `RUN` line should be enough in this file.


================
Comment at: clang/test/Analysis/bstring_UninitRead.c:91-94
+  p = mempcpy(dst, src, 4 * sizeof(int)); // expected-warning{{Bytes string function accesses uninitialized/garbage values}}
+  // FIXME: This behaviour is actually Unexpected and needs to be fix, 
+  // mempcpy seems to consider the src buffered byte as uninitialized
+  // and returning undef which is actually not the case It should return something like Unknown .
----------------



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120489/new/

https://reviews.llvm.org/D120489



More information about the cfe-commits mailing list