Use /dev/urandom instead of /dev/null for probing valid memory (#1586)
This commit is contained in:
parent
583c84ab4e
commit
b20fda2a4a
@ -60,7 +60,7 @@ static long area_is_valid(const void *ptr, size_t len) {
|
|||||||
valid_len = (long)len;
|
valid_len = (long)len;
|
||||||
#elif defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
|
#elif defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
|
||||||
if (!dymmy_initialized) {
|
if (!dymmy_initialized) {
|
||||||
if ((dummy_fd[1] = open("/dev/null", O_WRONLY)) < 0) {
|
if ((dummy_fd[1] = open("/dev/urandom", O_WRONLY)) < 0) {
|
||||||
if (pipe(dummy_fd) < 0) { dummy_fd[1] = 1; }
|
if (pipe(dummy_fd) < 0) { dummy_fd[1] = 1; }
|
||||||
}
|
}
|
||||||
dymmy_initialized = 1;
|
dymmy_initialized = 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user