[PATCH] D40121: [scudo] Make getNumberOfCPUs Fuchsia compliant v2

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 16 13:29:42 PST 2017


cryptoad added inline comments.


================
Comment at: lib/sanitizer_common/sanitizer_linux_libcdep.cc:590
+    }
+    d_type = (u8 *)entry + entry->d_reclen - 1;
+    if (entry->d_ino != 0 && *d_type == DT_DIR) {
----------------
Also make sure we still point to the buffer here.
Since we start with entry at the end of the buffer, if getdents fails we will reference memory outside of it.


Repository:
  rL LLVM

https://reviews.llvm.org/D40121





More information about the llvm-commits mailing list