There existed about a 1 in 4 billion chance that reading from /dev/urandom
authorMark Michelson <mmichelson@digium.com>
Wed, 21 Nov 2007 18:19:22 +0000 (18:19 +0000)
committerMark Michelson <mmichelson@digium.com>
Wed, 21 Nov 2007 18:19:22 +0000 (18:19 +0000)
commit3851bc9789bcdaf4259b1159cb1067559f89c47f
treef1637260251b287378f4adde2a63222c2cd44b38
parent6d8d66e9e7d795a5668ddcb8539a15b4458068d2
There existed about a 1 in 4 billion chance that reading from /dev/urandom
would return LONG_MIN (1 in 9 quintillion if using 64-bit longs). Since there
is no positive equivalent of LONG_MIN, the result of labs() in this case is
unpredictable. This fixes that situation.

(closes issue #11336, reported and patched by sperreault)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89487 65c4cc65-6c06-0410-ace0-fbb531ad65f3
main/utils.c