[asterisk-commits] russell: trunk r77268 - /trunk/main/utils.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 26 08:20:37 CDT 2007


Author: russell
Date: Thu Jul 26 08:20:36 2007
New Revision: 77268

URL: http://svn.digium.com/view/asterisk?view=rev&rev=77268
Log:
Ensure that the read from /dev/urandom returns a positive result
(closes issue #10308, reported by yehavi, patched by me)

Modified:
    trunk/main/utils.c

Modified: trunk/main/utils.c
URL: http://svn.digium.com/view/asterisk/trunk/main/utils.c?view=diff&rev=77268&r1=77267&r2=77268
==============================================================================
--- trunk/main/utils.c (original)
+++ trunk/main/utils.c Thu Jul 26 08:20:36 2007
@@ -830,7 +830,7 @@
 	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




More information about the asterisk-commits mailing list