Ensure that the read from /dev/urandom returns a positive result

(closes issue #10308, reported by yehavi, patched by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77268 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2007-07-26 13:20:36 +00:00
parent 7a97d49914
commit 3ed2deb7df

View File

@@ -830,7 +830,7 @@ long int ast_random(void)
if (dev_urandom_fd >= 0) {
int read_res = read(dev_urandom_fd, &res, sizeof(res));
if (read_res > 0)
return res;
return labs(res);
}
#endif
#ifdef linux