[PATCH] D56210: [Sanitizer] Disable arc4random seeing apis for non NetBSD platforms
David CARLIER via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 2 11:16:18 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rCRT350249: [Sanitizer] Disable arc4random seeding apis on for Non NetBSD platforms. (authored by devnexen, committed by ).
Repository:
rCRT Compiler Runtime
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56210/new/
https://reviews.llvm.org/D56210
Files:
test/sanitizer_common/TestCases/Posix/arc4random.cc
Index: test/sanitizer_common/TestCases/Posix/arc4random.cc
===================================================================
--- test/sanitizer_common/TestCases/Posix/arc4random.cc
+++ test/sanitizer_common/TestCases/Posix/arc4random.cc
@@ -15,8 +15,10 @@
}
void test_seed() {
+#ifdef __NetBSD__
time_t now = ::time(nullptr);
arc4random_addrandom((unsigned char *)&now, sizeof(now));
+#endif
}
void test_arc4random() {
@@ -34,7 +36,9 @@
void test_arc4random_buf10() {
printf("test_arc4random_buf10\n");
char buf[10];
+#ifdef __NetBSD__
arc4random_stir();
+#endif
arc4random_buf(buf, sizeof(buf));
print_buf((unsigned char *)buf, sizeof(buf));
}
@@ -42,7 +46,9 @@
void test_arc4random_buf256() {
printf("test_arc4random_buf256\n");
char buf[256];
+#ifdef __NetBSD__
arc4random_stir();
+#endif
arc4random_buf(buf, sizeof(buf));
print_buf((unsigned char *)buf, sizeof(buf));
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56210.179900.patch
Type: text/x-patch
Size: 924 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190102/e5a9ceab/attachment.bin>
More information about the llvm-commits
mailing list